Introduction: This is a detailed page of php apc-caused session failure to save bugs and solutions. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 335086 'rolling = 'no'>
APC Pairs
PHP
The acceleration effect of the script is obvious.
Php-FPM
The server load capability has been improved
2
Times, so in the production environment, use as much as possible
APC
To accelerate
PHP
Script.
This is my web tracking
Stress testing results, and in the production environment, use
APC
The script execution speed is indeed improved.
(May reach 10-20%
)
Use in production environment
Session_set_save_handler
Set
Save session
MySQL
Memory table, and installed
APC
Extension, and you will find that it cannot be saved
Session
After repeated troubleshooting, it is because
APC
Cause analysis:
The general environment session is statically compiled into PHP, so the session module must be loaded before the APC that is dynamically compiled into PHP. That is to say, during the request closure period, the APC request closes the function, the function will be called before the session request.
Therefore, when the Session Request closes the function call, the class table in the execution environment is empty, and a fatalError cannot be found for the class will be thrown.
-- In essence, the database instance has been destroyed, causing an error that cannot be seen.
The solution is very simple:
In PHP
ProgramExecuted, manually called
Session_write_close ();
Or in register_shutdown_function
It can also be called in the defined function.
However, if you use PHP
Default file storage
Session
This problem does not exist.
More articles about "session caused by php apc cannot save bugs and Solutions"
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/335086.html pageno: 10.