【发布时间】:2015-09-01 15:15:20
【问题描述】:
我已经尝试了以下所有方法,甚至尝试使用 require 但没有任何效果。
<?PHP include "myfile.php"; ?>
<?PHP include "/myfile.php"; ?>
<?PHP include "./myfile.php"; ?>
<?PHP include(__DIR__,"myfile.php"); ?>
<?PHP include "/public_html/myfile.php"; ?>
我的所有文件都在蓝色主机服务器上,每当它从myfile.php(位于public_html 目录中)创建对象时,它就会给出[01-Sep-2015 20:56:07 America/Denver] PHP Warning: include(): Failed opening '/MyConnection.php' for inclusion (include_path='.:/usr/php/54/usr/lib64:/usr/php/54/usr/share/pear:/home1/user/public_html') in /home1/user/public_html/myfile.php on line 29
[01-Sep-2015 20:56:07 America/Denver] PHP Fatal error: Class 'MyConnection' not found in /home1/user/public_html/myfile.php on line 32。
我已经调试了我的代码,每个语句都可以正常工作,除非或直到与myfile.php 无关,并且此代码在我的带有本地文件的 wampp 服务器上也可以正常工作。任何帮助将不胜感激。谢谢。
【问题讨论】:
-
status 500不是表示文件本身有问题吗? -
还可以对文件运行语法检查...或尝试直接从命令行访问。 @PaulCrovella 有正确的想法,它必须产生错误。
-
它在我的计算机(本地)上运行良好,并将文件包含在 php 页面中,但在这里不起作用。感谢大佬回复
标签: php require internal-server-error server-side-includes