2013-02-26 78 views
0

我们在一个托管服务器上遇到了一个非常奇怪的问题。include_path间歇性地更改值:可能是什么原因?

问题:好像PHP的include_path是半随机地被我目前无法确定的进程所改变。这很奇怪,因为我们禁用了操作码缓存,多次重新启动服务器,并使用mod_ruid2从彼此隔离的用户帐户。

再现这个问题(从这个除了没有内容)的脚本:

// Removing this call from the file makes the errors go away 
// This is just a part of our default include path, but is explicitly 
// defined here to be able to reproduce the problem 
set_include_path('.:/usr/local/share/php'); 

// Obviously, include_path should now be exactly the value as set above 
echo 'Include path is: '; 
var_dump(get_include_path()); 
echo '<br />'; 

// Debugging line: what is the cwd? 
echo 'CWD IS: '; 
var_dump(getcwd()) . '<br />'; 

// Test local file inclusion; this works 
require_once 'bar.php'; 

// Test global file inclusion from include_path (location: /usr/local/share/php/) 
// this intermittently fails 
require_once 'Zend/Loader/Autoloader.php'; 

我目前最好的猜测是某种竞争条件被触发。

正在发生什么的精确描述:

  1. 电话通过set_include_path()
  2. 电话get_include_path()

预期结果: 2应符合1

实际的间歇结果: 2是空的,或者含有(文档块)

  • 看似随机串,长期和短期以下的(随机)

    1. PHP源代码中的一个
    2. 有效路径,似乎已其他include_paths由其它用户设置
    3. 空字符串
    4. 字符串 '内容类型:text/html的'

    我们已经尝试了以下内容:

    1. 重新编译Apache和PHP与最新的PHP版本
    2. 重新编译Apache和PHP与APC关闭
    3. 清除APC缓存
    4. 重启Apache
    5. 重新启动整个服务器

    一些技术细节:

    • OS:CentOS的5.9
    • Web服务器:Apache的2.2.23
    • PHP:5.3。22个

    截图显示我的include_path变量的奇怪内容:突然我现在

    PHP comments now suddenly in my include path PHP注释现在包括路径


    HTTP headers now in include path HTTP头中包含路径


    01在包含路径

    Garbled content in the include path 乱码内容


    More garbled content in the include path 在包括路径


    我出的选项和思路更加乱码内容。任何帮助将不胜感激。

  • +0

    冒着明显的风险,这看起来像一个PHP的错误。 – zneak 2013-02-26 16:20:38

    +0

    您可以尝试在try catch中打包调用并打印出堆栈跟踪。可能有助于缩小原因。 – BenOfTheNorth 2013-02-26 16:28:23

    回答

    1

    这个问题现在似乎已经解决了。由于此特定服务器是运行WHM/Cpanel的专用服务器,因此我已将此问题升级为Cpanel支持。

    经过一番研究,问题被缩小到homeloader.so模块,这使得每用户PEAR库成为可能。禁用此模块后,症状消失。

    此问题的根本原因仍在调查中,但如果其他人遇到类似问题,这可能是需要考虑的问题。

    相关问题