EACCELERATOR+PHP54 causes Smarty Update template 500 error

Source: Internet
Author: User
Tags apc php error php error log
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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.