当我在浏览器中执行我的脚本时,我对普通的 php 包含有一个非常奇怪的问题。在外壳中一切正常。所以我假设它要么是权限问题,要么是 php 配置问题,但事实证明并非如此。真正奇怪的是脚本在大约一个小时前运行得很好。
<?php
// sub/cron.php
error_reporting(E_ALL);
ini_set('display_errors', 1);
include '../config.php';
include '../facebook.php';
include '../ez_sql_core.php';
include '../ez_sql_mysql.php';
die();
要包含的文件在 httpdocs 中,在 httpdocs/sub 中的 cron.php
- php.ini 中的 open_basedir 绝对设置正确
(/srv/www/vhosts/xxxxx/httpdocs:/tmp)
- 我删除了
die();
我插入的所有其他 php 代码以排除任何其他 php 问题 - 文件权限都设置正确
- 我也尝试了绝对路径
- 我读了很多其他线程!
错误如下:
Warning: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/srv/www/vhosts/xxxxx/httpdocs:/tmp) in /srv/www/vhosts/xxxxx/httpdocs/iblink/mobile/cron.php on line 9
Warning: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/srv/www/vhosts/j04/api.appworkx.de/httpdocs:/tmp) in /srv/www/vhosts/j04/api.appworkx.de/httpdocs/iblink/mobile/cron.php on line 10
Warning: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/srv/www/vhosts/j04/api.appworkx.de/httpdocs:/tmp) in /srv/www/vhosts/xxxxx/httpdocs/iblink/mobile/cron.php on line 11
Warning: include(): open_basedir restriction in effect. File() is not within the allowed path(s): (/srv/www/vhosts/xxxxx/httpdocs:/tmp) in /srv/www/vhosts/j04/api.appworkx.de/httpdocs/iblink/mobile/cron.php on line 12
也奇怪的是,File()
是空的。服务器管理员不解。
有没有人进一步的想法可能是什么原因?
提前谢谢了!