Reputation: 67
I'm trying to call an example php file "example.php" that return "Hello world" to test some functionality in my app.
When i call URL:
"http://www.example.com:2083/home/public_html/example.php"
the server redirect to cpanel access page. So, after some google resources, i've generated an API TOKEN through cpanel API token manager and i've tried to call this file using curl like this:
"curl -H "Authorization: cpanel username:API_TOKEN" "https://www.example.it:2083/execute/home/public_html/example.php"
but always retrive this message:
{"metadata":{},"data":null,"errors":["Illegal function name:public_html/example.php"],"warnings":null,"messages":null,"status":0}"
.
Is this the right way to call a php file hosted on cpanel? Thanks for any help :)
Upvotes: 0
Views: 354
Reputation: 316
Looks like you are calling the file wrong way.
Taking this URL are reference: http://www.example.com:2083/home/public_html/example.php
The correct way to call it would simply be: http://www.example.com/example.php
Upvotes: 1