簡體   English   中英

在cpanel中調用php文件

[英]Call php file in cpanel

我正在嘗試調用返回“Hello world”的示例 php 文件“example.php”來測試我的應用程序中的某些功能。

當我調用 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"但總是檢索此消息: {"metadata":{},"data":null,"errors":["Illegal function name:public_html/example.php"],"warnings":null,"messages":null,"status":0}"

這是調用 cpanel 上托管的 php 文件的正確方法嗎? 謝謝你的幫助:)

看起來您以錯誤的方式調用文件。

  1. 您的網站“:2083”之后的端口會將您轉發到cpanel。
  2. 您不需要將整個目錄“/home/public_html”來調用它,因為您的域名本身會將您指向“public_html”的“index”目錄。

Taking this URL are reference: http://www.example.com:2083/home/public_html/example.php

調用它的正確方法是: http://www.example.com/example.php

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM