PHP 包括不工作 - 因为服务器配置?
PHP include not working - because of server config?
我有以下两个文件:
www.domain.com/test.php
www.domain.com/sub/test.php
我想在根文件中包含子文件并尝试了以下操作:
<?php
include ("http://www.domain.com/sub/test.php");
?>
...但这不起作用。我也尝试使用 include("/sub/test.php");
但得到相同的结果 (即空页)。
phpinfo()
给我以下信息:
- include_path .:
- allow_url_include关闭
在此先感谢您的帮助
配置很清楚:
allow_url_include Off
这意味着 URL 个文件在该服务器上被拒绝。
对于其余部分 - include "sub/test.php"
应该有效(注意从开头删除的斜线)。另请注意,该路径是相对于您当前目录的,或者它会在当前 include_path
.
中查找文件
我有以下两个文件:
www.domain.com/test.php
www.domain.com/sub/test.php
我想在根文件中包含子文件并尝试了以下操作:
<?php
include ("http://www.domain.com/sub/test.php");
?>
...但这不起作用。我也尝试使用 include("/sub/test.php");
但得到相同的结果 (即空页)。
phpinfo()
给我以下信息:
- include_path .:
- allow_url_include关闭
在此先感谢您的帮助
配置很清楚:
allow_url_include Off
这意味着 URL 个文件在该服务器上被拒绝。
对于其余部分 - include "sub/test.php"
应该有效(注意从开头删除的斜线)。另请注意,该路径是相对于您当前目录的,或者它会在当前 include_path
.