• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

PHP 5.5 FastCGI: Premature End Of Script

Jon_Larson

New Pleskian
Hello,

I've been working on a project that I am trying to utilize some of the new functions from PHP 5.5 so I changed the PHP version from 5.3 to 5.5 on this domain, but I am getting a 500 error. I've found this kb: http://kb.odin.com/en/120785 which is my exact issue, but the resolution doesn't work for me.

All of the permissions are set right, all of the modules are compiled and registered correctly, but I'm still getting a 500 error.

From error_log:
Code:
[Sun May 31 20:32:31 2015] [warn] [client] (104)Connection reset by peer: mod_fcgid: error reading data from FastCGI server 
[Sun May 31 20:32:31 2015] [error] [client] Premature end of script headers: adduser-exec.php

# /usr/local/psa/admin/bin/php_handlers_control --list :
Code:
                id:  display name:  version:    type:                        cgi-bin:                    cli-bin:                        php.ini:  system
             module          5.3.3     5.3.3   module                /usr/bin/php-cgi                                                /etc/php.ini
            fastcgi          5.3.3     5.3.3  fastcgi                /usr/bin/php-cgi                                                /etc/php.ini
                cgi          5.3.3     5.3.3      cgi                /usr/bin/php-cgi                                                /etc/php.ini
    plesk-php56-cgi          5.6.9     5.6.9      cgi  /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini  *
    plesk-php55-cgi         5.5.25    5.5.25      cgi  /opt/plesk/php/5.5/bin/php-cgi  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini  *
    plesk-php54-cgi         5.4.41    5.4.41      cgi  /opt/plesk/php/5.4/bin/php-cgi  /opt/plesk/php/5.4/bin/php  /opt/plesk/php/5.4/etc/php.ini  *
    plesk-php53-cgi         5.3.29    5.3.29      cgi  /opt/plesk/php/5.3/bin/php-cgi  /opt/plesk/php/5.3/bin/php  /opt/plesk/php/5.3/etc/php.ini  *
plesk-php54-fastcgi         5.4.41    5.4.41  fastcgi  /opt/plesk/php/5.4/bin/php-cgi  /opt/plesk/php/5.4/bin/php  /opt/plesk/php/5.4/etc/php.ini  *
plesk-php53-fastcgi         5.3.29    5.3.29  fastcgi  /opt/plesk/php/5.3/bin/php-cgi  /opt/plesk/php/5.3/bin/php  /opt/plesk/php/5.3/etc/php.ini  *
plesk-php55-fastcgi         5.5.25    5.5.25  fastcgi  /opt/plesk/php/5.5/bin/php-cgi  /opt/plesk/php/5.5/bin/php  /opt/plesk/php/5.5/etc/php.ini  *
plesk-php56-fastcgi          5.6.9     5.6.9  fastcgi  /opt/plesk/php/5.6/bin/php-cgi  /opt/plesk/php/5.6/bin/php  /opt/plesk/php/5.6/etc/php.ini  *

This part was weird, I got an error stating I was out of memory but I'm not..
# /opt/plesk/php/5.5/bin/php-cgi -v:
Code:
Sun May 31 20:40:32 2015 (4547): Fatal Error Unable to allocate shared memory segment of 134217728 bytes: mmap: Cannot allocate memory (12)

# free -m :
Code:
             total       used       free     shared    buffers     cached
Mem:          2048        388       1659        104          0        242
-/+ buffers/cache:        146       1901

I am running within a Virtuozo container so,
# cat /proc/user_beancounters :
Code:
Version: 2.5
       uid  resource                     held              maxheld              barrier                limit              failcnt
 80721500:  kmemsize                 21965676             24489984             37748736             41943040                    0
            lockedpages                     0                    0                  256                  256                    0
            privvmpages                227198               231995               524288               550502                    0
            shmpages                    26820                26820                32768                49152                   80
            dummy                           0                    0  9223372036854775807  9223372036854775807                    0
            numproc                       103                  103                  128                  128                    1
            physpages                  100446               109941               524288               524288                    0
            vmguarpages                     0                    0               262144               262144                    0
            oomguarpages                59828                59828               262144               262144                    0
            numtcpsock                     28                   28                  360                  360                    0
            numflock                       14                   17                  256                  288                    0
            numpty                          1                    1                   16                   16                    0
            numsiginfo                      0                   63                  256                  256                    0
            tcpsndbuf                  211592               211592              1720320              2703360                    0
            tcprcvbuf                  212992               215304              1720320              2703360                  281
            othersockbuf               231200               232488              1126080              2097152                    0
            dgramrcvbuf                     0                    0               262144               288358                    0
            numothersock                  161                  162                  360                  360                    0
            dcachesize                6290293              6290633              5242880              6291456                    0
            numfile                      2515                 2695                 4096                 4096                    0

Any ideas as to how to correct this? Thanks!
 
I switched to CGI from FastCGI in attempt to get a more detailed error message and I got this:
Code:
[Sun May 31 21:13:10 2015] [error] [client] Sun May 31 21:13:10 2015 (5318): 
[Sun May 31 21:13:10 2015] [error] [client] Fatal Error 
[Sun May 31 21:13:10 2015] [error] [client] Unable to allocate shared memory segment of 134217728 bytes: mmap: Cannot allocate memory (12) 
[Sun May 31 21:13:10 2015] [error] [client] 
[Sun May 31 21:13:10 2015] [error] [client] Premature end of script headers: cgi_wrapper

Why would it say it can't allocate memory when I have plenty of free memory?
I don't get these errors when I'm on PHP 5.3. This error occurs when I switch the vhost to 5.5 or 5.6
 
Unable to allocate shared memory segment

Try to increase shmpages resource for this Virtuozzo container at least. You have failcounters for this resource.
 
Is opcache or apcu enabled?

If yes try to disable it... In my case i can't use opcache in virtuozzo.
 
I emailed my host to see if I could get the limit increased, but I'll likely have to upgrade to a bigger package. Both opcache and apcu are disabled.
 
I will have to upgrade to a larger VPS if I wish to increase the shmpages... Why is it reaching the limit though if 5.3 does not? If i uninstall 5.3 and run 5.5 on all vhosts, will that correct my problem?
 
Back
Top