douyaosi3164 2011-03-02 21:34
浏览 91
已采纳

Apache运行Zend Framework与多个虚拟主机的间歇性500错误

We have been working on a project for several months without any problems until a set of recent updates. The server is running Amazon Linux AMI release 2010.11.1, with Apache 2.2.16 and PHP 5.3.3. The project is divided into a few separate developer branches, running as virtual hosts, each with a completely separate copy of all the code including Zend Framework 1.11.3. The project also includes Doctrine 2.0.1, but I don't think that is where the problem is. I have experimented with APC in the past, but I don't even have it installed right now. The issue seems to occur the most when multiple users are hitting the server across different branches. I suspect that the issue could be related to differing versions of certain core classes that are required during the Zend Framework bootstrap process, but I can't figure out what the root cause is. We have tried forcing all the branches to be at the same version from our git repo, and then restarted Apache. This temporarily resolves the issue, but it soon returns. It all began a week ago when I merely installed a set of mainstream updates for Linux, PHP, and Zend Framework. When the issue is occurring, it even propagates into our phpmyadmin virtual host, which doesn't even have anything to do with Zend Framework. I am stumped. Following is the set of errors we see in the Apache log:

[Wed Mar 02 20:32:40 2011] [error] [client 127.0.0.1] PHP Warning:  array_keys() expects parameter 1 to be array, null given in /var/www/dev/library/Zend/Loader/Autoloader.php on line 251, referer: https://foo.bar/admin/asset_manage/search
[Wed Mar 02 20:32:40 2011] [error] [client 127.0.0.1] PHP Warning:  Invalid argument supplied for foreach() in /var/www/dev/library/Zend/Loader/Autoloader.php on line 345, referer: https://foo.bar/admin/asset_manage/search
[Wed Mar 02 20:32:40 2011] [error] [client 127.0.0.1] PHP Warning:  array_key_exists() expects parameter 2 to be array, null given in /var/www/dev/library/Zend/Loader/Autoloader.php on line 194, referer: https://foo.bar/admin/asset_manage/search
[Wed Mar 02 20:32:40 2011] [error] [client 127.0.0.1] PHP Fatal error:  Class 'Zend_Config_Ini' not found in /var/www/dev/library/Zend/Application.php on line 383, referer: https://foo.bar/admin/asset_manage/search
  • 写回答

3条回答 默认 最新

  • doubi7739 2011-03-03 20:25
    关注

    Well, after much agony over this issue, it turns out the problem was caused by a change in the behavior of the php realpath_cache. When I set realpath_cache_ttl = 0 in my php.ini, the issue with the improperly loading classes goes away.

    I am not sure how this got introduced in these updates, but I don't think the cache is required on a dev box, so this gets me back on track. On a production server, I should only have one instance of the app running per Apache server anyway (no virtual hosts), so I could probably use the cache in that scenario.

    If anyone has any additional insight into the cause of the realpath_cache issue, I wouldn't mind hearing it.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题