ホスティングサーバーの1つで非常に奇妙な問題が発生しています。
問題: 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';
私の現在の最良の推測は、ある種の競合状態が引き起こされているということです。
何が起こっているかの正確な説明:
- set_include_path()の呼び出し
- get_include_path()の呼び出し
期待される結果: 2は1と一致する必要があります
実際の断続的な結果: 2は空であるか、次のいずれかが含まれています(ランダムに)
- PHPソースコード(docblocks)
- 長い文字列と短い文字列の両方の一見ランダムな文字列
- 他のユーザーによって設定されたと思われる他のinclude_pathsへの有効なパス
- 空の文字列
- 文字列'Content-type:text / html'
私たちは以下を試しました:
- 最新のPHPバージョンでApacheとPHPを再コンパイルします
- APCをオフにしてApacheとPHPを再コンパイルする
- APCキャッシュをクリアする
- Apacheを再起動します
- サーバー全体を再起動します
いくつかの技術的な詳細:
- OS:CentOS 5.9
- Webサーバー:Apache 2.2.23
- PHP:5.3.22
include_path変数の奇妙な内容を示すスクリーンショット:
PHPコメントが突然私のインクルードパスに追加されました
HTTPヘッダーがインクルードパスに含まれるようになりました
インクルードパスの文字化けしたコンテンツ
インクルードパスの文字化けしたコンテンツ
私は選択肢やアイデアがありません。どんな助けでも大歓迎です。