我正在嘗試呼叫回傳“Hello world”的示例 php 檔案“example.php”來測驗我的應用程式中的某些功能。
當我呼叫 URL 時:
"http://www.example.com:2083/home/public_html/example.php"服務器重定向到 cpanel 訪問頁面。因此,在搜索了一些 google 資源之后,我通過 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 檔案的正確方法嗎?謝謝你的幫助 :)
uj5u.com熱心網友回復:
看起來您以錯誤的方式呼叫檔案。
- 您網站“:2083”之后的埠會將您轉發到 cpanel。
- 你不需要把整個目錄“/home/public_html”放在里面來呼叫它,因為你的域名本身將你指向“public_html”的“index”目錄。
以這個網址為參考:http : //www.example.com : 2083/ home/public_html/ example.php
呼叫它的正確方法是:http : //www.example.com/example.php
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/389081.html
