问题
For some reason my classes are not loaded correctly. They are either failing to load, or the wrong version of the class is loaded (taken from the wrong directory).
After some debugging, it became apparent that the include path that is used is in fact the include path from the previous request.
However, when I run get_include_path()
the logged result is correct, but it's clear from the behavior that in practice it's not used, and instead used the path from the previous request.
My code is PHP with the Yii framework. The framework manipulates includepath
at runtime.
PHP versions is 5.31
, xampp, windows7
edit: disabling apc solved the problem
回答1:
I see this pretty regularly with APC. Most often, when APC fills up.
Run the apc.php script (included with most APC installs) in your browser to check your utilization. Ouput looks like this:
If APC is full, increase the amount of memory allocated to it. Somewhere in your PHP config, there's a config option controlling this: apc.shm_size=64
. This allocates 64 meg of ram. Increase it until you have some breathing room. You'll need to restart apache for this change to take effect.
If you deploy your application to a different path on disk every time, you should probably purge APC -- otherwise the old cache entries tend to linger. The easiest way to do this is with a graceful restart of your webserver. Note that on an active production server, this will interrupt active requests for a second or so.
来源:https://stackoverflow.com/questions/5561275/php-apc-includepath-from-the-previous-request-is-used-instead-of-current