Inconsistent results with PHP Reflection API

旧城冷巷雨未停 提交于 2019-12-11 06:42:43

问题


I have an application that works perfectly on both Windows & Mac that uses the PHP5 Reflection API.

I attempted to deploy the application to a Linux machine (CentOS box running PHP 5.3.6 -production server), only to find that the ReflectionMethod::getDocComment() function does not return anything. I investigated for a little while, and discovered that the line-endings were a potential culprit.

I used the dos2unix utility on my server to change the line-endings all to Unix-style, and the script works. Now here's the strange part: it only works once. By this, I mean that the script which returns the data from ReflectionMethod::getDocComment() works once, and then (without any modification to the files on disk or the code) it reverts back to not working.

Any help or advice would be greatly appreciated.


回答1:


Instead of turning it out globally you may use php_flag in your .htaccess like so :

php_flag eaccelerator.enable 0
php_flag eaccelerator.optimizer 0

I had the same issue and it took me some time to figuring out (3 hours) because I didn't own the production server.



来源:https://stackoverflow.com/questions/9676328/inconsistent-results-with-php-reflection-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!