[英]Call php file in cpanel
I'm trying to call an example php file "example.php" that return "Hello world" to test some functionality in my app.我正在尝试调用返回“Hello world”的示例 php 文件“example.php”来测试我的应用程序中的某些功能。
When i call URL: "http://www.example.com:2083/home/public_html/example.php"
the server redirect to cpanel access page.当我调用 URL: "http://www.example.com:2083/home/public_html/example.php"
服务器重定向到 cpanel 访问页面。 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}"
. 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"
但总是检索此消息: {"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?这是调用 cpanel 上托管的 php 文件的正确方法吗? Thanks for any help:)谢谢你的帮助:)
Looks like you are calling the file wrong way.看起来您以错误的方式调用文件。
Taking this URL are reference: http://www.example.com:2083/home/public_html/example.php 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调用它的正确方法是: http://www.example.com/example.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.