Premature end of script headers: php5 Symfony produces 500 internal server error

I am facing a problem that leaves me at a standstill, so, in turn, I turn to you! Symfony recently declined, getting an internal apache -500 error. After removing the symfony cache, the site returns. After some further research, I found the error "Premature end of script headers: php5". There were no errors on the site like this for 1 year, and we did not make any changes to this site, and this happens regularly (once a week). The following are the log files.

[Sat Aug 28 06:20:30 2010] [error] [client 206.131.184.1] Premature end of script headers: php5

This email was also sent recently from MT, possibly related to how I feel may be directly related to this issue.

We turned our attention to the fact that your service ----.com generates an unusually large number of file system locks in the cluster in which your account is hosted. Websites or scripts that incorrectly use NFS file locking can often generate this error, which greatly affects cluster performance for other clients. This is a violation of our AUP, which can be found at ' http://mediatemple.net/company/legal/aup_general.php '.

We tracked the problem of blocking files into the following file, which is blocked several times:

/ domains / ----. Com / symfony / cache / interface / prod / configuration / routing / symfony.routing.configuration.cache / domains / ----. Com / symfony / cache / interface / prod / configuration / routing / symfony.routing.data.cache

, ( script); script, . script , .

- , , , , .

+3
3

. APC . sfFileCache view_cache, i18n .

APC , .

APC symfony: http://www.zalas.eu/symfony-meets-apc-alternative-php-cache

+1

, Google Chrome . , Monolog, "chromephp".

config_dev.yml:

monolog:
handlers:
    main:
        type:  stream
        path:  %kernel.logs_dir%/%kernel.environment%.log
        level: debug
    firephp:
        type:  firephp
        level: info
    chromephp:
        type:  chromephp
        level: info

chromephp .

+10

, Symfony lib/cache/sfFileCache.class.php read(). Symfony . , Symfony . , lib/log/sfFileLogger.class.php lock doLog() , ( fwrite()), .

, Symfony.

"Premature end of script headers" is not a PHP error message. The web server issues this message when the backend (PHP in this case) does not send headers. This is most likely because he is dying before he can do anything. You should find the PHP error log and see the real error message. However, note that Symfony uses a lot @to suppress errors in function calls, so you cannot find anything.

+2
source

Source: https://habr.com/ru/post/1762106/


All Articles