【发布时间】:2022-01-22 23:35:51
【问题描述】:
我正在尝试调用返回“Hello world”的示例 php 文件“example.php”来测试我的应用程序中的某些功能。
当我调用 URL 时:
"http://www.example.com:2083/home/public_html/example.php" 服务器重定向到 cpanel 访问页面。所以,在一些谷歌资源之后,我通过 cpanel API 令牌管理器生成了一个 API TOKEN,我尝试使用 curl 调用这个文件,如下所示:
"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}".
这是调用托管在 cpanel 上的 php 文件的正确方法吗? 感谢您的帮助:)
【问题讨论】:
-
请分享更多细节。通常,您不会在 cPanel 本身上托管文件