繁体   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