Issue background
After updating the smarty template for the game.37.com Business , multiple Error Records appear on the server . errors in the PHP error log are as follows:
[16-may-2016 15:46:01 Asia/shanghai] PHP Fatal error:call to undefined function content_57397470478e99_59376883 () in/*/template_c/ 6aede77242b285842c628673e93d8bf1bd4bc6b0.file.server_list.htm.php on line 67
Symptom: After updating the template, the first access to the report error, again access normal.
Troubleshoot problems
According to the experience of normal use of smarty , updating the template will not cause PHP to report errors. Therefore, the conjecture may be the server environment problem, lists the special configuration environment to troubleshoot.
In a pre-release environment, the accelerator eacceleratoris first checked. Because the eaccelerator Accelerator caches PHP opcode, it can cause the problem.
Testing in a test environment
Debug Page:http://game.37.com/server_list_275.html
Debug Template:main.htm
generated by Smarty compile file:/ */template_c/6aede77242b285842c628673e93d8bf1bd4bc6b0.file.server_list.htm.php
Check the smarty compilation file
Comparing the 2 editing files after updating the smarty template, we found that the PHP error was caused by calling the function in the old template.
PHP exception error message php Fatal error:call to undefined function content_573a944d7a2608_39051073 () in/*/template_ c/6aede77242b285842c628673e93d8bf1bd4bc6b0.file.server_list.htm.php on line
Smarty Working principle diagram:
The problem is that after updating the smarty template, although smarty generates a new compiled file, the contents of the old file are still cached by the accelerator, which contains the name of a function in the calling template file. Open the hit log for the accelerator to view the related records:
Solution Solutions
1) Configure the accelerator filter parameter, Smarty compiled files are not cached
Eaccelerator.filter= "!/*/template_c/*.php"
But to assess the impact on performance
2) Replace with the accelerator APC
Cause: The Eaccelerator is now in version 1.0-dev , not officially released. APC originates from the official and can be downloaded to the stable version.
The above describes the EACCELERATOR+PHP54 cause Smarty Update template 500 error, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.