Getting error "End of script output before headers: ea-php56"

Jun 12, 2018
8
0
1
West Sussex, UK
cPanel Access Level
Reseller Owner
Hi

We are using Cloudlinux 7.5 and experiencing a 503 error on just one page of a website.
The host are helpful and have looked into it and found the following error:

[Tue Jun 12 21:02:29.381172 2018] [cgid:error] [pid 447038:tid 140492432189184] [client IPREMOVED:63043] End of script output before headers: ea-php56
[Tue Jun 12 21:02:31.561387 2018] [cgid:error] [pid 447038:tid 140492432189184] [client IPREMOVED:63043] End of script output before headers: ea-php56

The site is supposed to be running PHP 7 so it's a bit odd it's referring to ea-php56. However, I have added a phpinfo file on the site and it confirms we are running PHP 7.

If it was a code file I was expecting to see the name of the file, not sure what to do next solving this issue?

Thanks
Dave
 
Last edited by a moderator:

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
Hi @madesimplemedia


It does seem odd that it would be referencing php 5.6. Do you know what PHP handler you're using (it should be listed in the phpinfo page)? What's in the .htaccess for the domain?


Thanks!
 
Jun 12, 2018
8
0
1
West Sussex, UK
cPanel Access Level
Reseller Owner
Hi thanks for your reply. The handler is LiteSpeed V7.1
The host rolled back to Apache and said the error was still there.

.htaccess contains a few rewrite rules, nothing that would potentially cause this issue, although the server has added this too:

Code:
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 120
   php_value max_input_time 120
   php_value max_input_vars 10000
   php_value memory_limit 256M
   php_value post_max_size 256M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 256M
   php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php70 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
Hi @madesimplemedia

This seems to be the issue:

Code:
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php5_module>
   php_flag asp_tags Off
   php_flag display_errors Off
   php_value max_execution_time 120
   php_value max_input_time 120
   php_value max_input_vars 10000
   php_value memory_limit 256M
   php_value post_max_size 256M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
   php_value upload_max_filesize 256M
   php_flag zlib.output_compression On
</IfModule>
# END cPanel-generated php ini directives, do not edit
Based on this it seems that at some point you were running php 5.6 and these values weren't replaced when you moved to a different version of PHP. Though, it does say not to remove this due to unexpected behavior it should be only relevant if you're using that version of PHP and I'd like to know if the issue persists if you remove it.

Thanks!
 
Jun 12, 2018
8
0
1
West Sussex, UK
cPanel Access Level
Reseller Owner
Sorry I also have this on the end of the htaccess file:
Code:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php70” package as the default “PHP” programming language.
<IfModule mime_module>
  AddType application/x-httpd-ea-php70 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
I removed the PHP5 code but it hasn't made any difference unfortunately.
I did a graceful restart of Litespeed too but no change.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
That last portion with the AddType for PHP 7.0 is fine if you're using PHP 7.0. Can you show me the php info page values for the following:

PHP Version
Server API
Configuration File
Loaded Configuration File
Scan this dir for additional .ini files
Additional .ini files parsed
 
Jun 12, 2018
8
0
1
West Sussex, UK
cPanel Access Level
Reseller Owner
Here we go:

Code:
PHP Version  7.0.30
Server API  LiteSpeed V7.1
Configuration File  /opt/cpanel/ea-php70/root/etc
Loaded Configuration File  /opt/cpanel/ea-php70/root/etc/php.ini
Scan this dir for additional .ini files  /opt/cpanel/ea-php70/root/etc/php.d
Additional .ini files parsed:
/opt/cpanel/ea-php70/root/etc/php.d/10-opcache.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-bcmath.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-bz2.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-calendar.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-ctype.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-curl.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-dba.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-dom.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-enchant.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-exif.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-fileinfo.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-ftp.ini,
 /opt/cpanel/ea-php70/root/etc/php.d/20-gd.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-gettext.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-gmp.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-iconv.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-imap.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-intl.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-json.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-ldap.ini,
/opt/cpanel/ea-php70/root/etc/php.d/20-mbstring.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-mcrypt.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-mysqlnd.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-odbc.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-pdo.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-pgsql.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-phar.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-posix.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-pspell.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-shmop.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-simplexml.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-snmp.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-soap.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-sockets.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-sqlite3.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-sysvmsg.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-sysvsem.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-sysvshm.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-tokenizer.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-xml.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-xmlwriter.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/20-xsl.ini,
 /opt/cpanel/ea-php70/root/etc/php.d/20-zip.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/30-mysqli.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/30-pdo_mysql.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/30-pdo_odbc.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/30-pdo_pgsql.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/30-pdo_sqlite.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/30-wddx.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/30-xmlreader.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/30-xmlrpc.ini, 
/opt/cpanel/ea-php70/root/etc/php.d/zzzzzzz-pecl.ini
 

Davidjr150

Registered
Feb 2, 2019
2
0
1
Spain
cPanel Access Level
Website Owner
I am having a similar issue End of script output before headers: index.php and a few days ago the server added this code to my htaccess file
Code:
# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
   php_flag display_errors On
   php_value max_execution_time 300
   php_value max_input_time 600
   php_value max_input_vars 1000
   php_value memory_limit 512M
   php_value post_max_size 256M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php70"
   php_value upload_max_filesize 128M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit
And i also have to files that i hadn't a month ago (i checked the backup) the files are php.ini and .user.ini both files contains the same code:

user.ini

Code:
; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

display_errors = On
max_execution_time = 300
max_input_time = 600
max_input_vars = 1000
memory_limit = 1024M
post_max_size = 256M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php70"
upload_max_filesize = 128M
zlib.output_compression = Off
and php.ini

Code:
; cPanel-generated php ini directives, do not edit
; Manual editing of this file may result in unexpected behavior.
; To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
; For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)

allow_url_fopen = On
allow_url_include = Off
display_errors = On
enable_dl = Off
file_uploads = On
max_execution_time = 300
max_input_time = 600
max_input_vars = 1000
memory_limit = 512M
post_max_size = 256M
session.gc_maxlifetime = 1440
session.save_path = "/var/cpanel/php/sessions/ea-php70"
upload_max_filesize = 128M
zlib.output_compression = Off