End of script output before headers: index.php

16 posts / 0 new
Last post
#1 Tue, 04/25/2017 - 03:19
ayhan

End of script output before headers: index.php

hello, Operating system CentOS Linux 7.3.1611

Webmin version 1.831

Virtualmin version 5.07

i m getting this error when i use phpexcel writer; (laravel 5.3)

$objWriter = \PHPExcel_IOFactory::createWriter($excel, 'Excel2007'); $objWriter->save(storage_path('form'.$form->id.'.xlsx')) ;
  • End of script output before headers: index.php

  • [fcgid:error] [pid 10498] mod_fcgid: process /home/SITENAME/fcgi-bin/php7.1.fcgi(10637) exit(communication error), get unexpected signal 11

how can i fix it.

Tue, 04/25/2017 - 08:47
andreychek

Howdy,

You may want to see if switching your PHP Execution Mode to "CGI" yields different results, or at least a better error message. FCGID isn't always known for it's great error messages.

You can switch that in Server Configuration -> Website Options.

-Eric

Tue, 04/25/2017 - 09:06
ayhan

switched to CGI wrapper (run as virtual server owner) ,

and:

End of script output before headers: php7.1.cgi, referer:

kernel: php-cgi[1042]: segfault at 8 ip 00007f8603990195 sp 00007ffeb812baf0 error 4 in php-cgi[7f8603743000+40d000]

Tue, 04/25/2017 - 09:25
andreychek

Hmm, yeah segfaults are no good and could be a sign of a software bug, or a resource problem.

Do you perhaps have another PHP version available that you could try?

PHP 7.1 isn't available by default in any of the standard Linux distributions, so I'm curious if there's something related to it that's causing the issue you're experiencing.

Another option you could try is to disable any caching modules... we sometimes see odd things come up with some of the PHP caching options.

Lastly, verify that there's enough RAM on your server. What is the output of "free -m"?

-Eric

Tue, 04/25/2017 - 09:44
ayhan
total used free shared buff/cache available

Mem: 32171 903 29856 10 1411 30741

Swap: 4063 0 4063

Tue, 04/25/2017 - 09:53
ayhan

same error on php70

kernel: php70-cgi[3762]: segfault at 8 ip 00007fd596fc62e5 sp 00007ffc015aab80 error 4 in php-cgi[7fd596dc8000+377000]

Tue, 04/25/2017 - 10:14
andreychek

Howdy,

Nuts!

Yeah you do appear to have plenty of RAM.

Which repository did those PHP packages come from?

And are there any PHP caching modules enabled?

-Eric

Tue, 04/25/2017 - 10:15
ayhan

same on php 56

End of script output before headers: php5.6.cgi

kernel: php56-cgi[6480]: segfault at 8 ip 00007f7fc34e6a2e sp 00007ffd567b8cd0 error 4 in php-cgi[7f7fc32ea000+398000]

Tue, 04/25/2017 - 10:16
ayhan

packages from : el7.remi.x86_64

php56 -m [PHP Modules] bz2 calendar Core ctype curl date dom ereg exif fileinfo filter ftp gettext hash iconv imap json libxml mbstring mcrypt mhash mssql mysql mysqli mysqlnd odbc openssl pcntl pcre PDO pdo_dblib pdo_mysql PDO_ODBC pdo_sqlite Phar phpiredis posix readline Reflection session shmop SimpleXML sockets SPL sqlite3 standard sybase_ct sysvmsg sysvsem sysvshm tokenizer wddx xml xmlreader xmlwriter xsl zip zlib

php56 -v PHP 5.6.30 (cli) (built: Jan 19 2017 07:08:58) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

Tue, 04/25/2017 - 10:38
andreychek

Howdy,

I know there are folks using the REMI repo with great success (and Diabolico, who wrote a tutorial on how to use REMI, may end up chiming in here :-), but if you're seeing unusual issues with PHP segfaulting, that might be one thing to look into... whether it's an issue with packages coming from that particular repo.

We don't generally recommend packages from any repo other than the default CentOS repo, and then the SCL repo for more recent PHP versions.

Again, not everyone using REMI has that issue... in fact it's been quite awhile since I've run into a PHP segfault issue that severe. But there's a reason we recommend some repos and not others, and we have seen some unusual issues come from third party repos such as that one :-)

Before you go changing repos though, the other thing I can suggest is to be super-sure that you don't have any PHP caching modules installed or enabled, as we've seen some pretty unusual issues coming from those.

-Eric

Tue, 04/25/2017 - 12:46
ayhan
Tue, 04/25/2017 - 15:16
Diabolico
Diabolico's picture

That error usually indicate two problems:
1. Scrip/software problem with cache (opcache, apcu...)
2. Problem with a software, e.g. installed scripts, CMS, etc.

Based on your first post i would say something is breaking between Laravel 5.3 and Remi PHP. Did you check if you have installed all PHP modules required for Laravel and did you try to disable any caching. Please note that opcache comes integrated with PHP 5.6 and up but it should be set off by default.
Last but not least, did you try with never version of Laravel (i think last one is 5.4) or you could post on Remi forum, he is very quick to answer to all questions.

As a side note, i'm using Remi PHP 7.1.x for almost 2 months (maybe more) and didnt encounter single problem. Actually this version of PHP is pushing the limits quite high. The one time i had a problem was because of some WP plugin and really bad coding and nothing to do with Remi PHP.

EDIT: Just to rule this out, could you switch back to 7.1 and run php --modules, then post it here.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Wed, 04/26/2017 - 02:07
ayhan

hello,

  • i disabled all caching. apc opcache ...
  • i m using laravel 5.3
  • everythink was fine befor phpexcel library.
  • phpexcel 's save() function is the beging of segfault.

but now ;

  • i installed rh-php70-php
  • it works. with same laravel 5.3 and same phpexcel lib.
Wed, 04/26/2017 - 04:30
Diabolico
Diabolico's picture

Could you report this problem to Remi forum https://forum.remirepo.net/. I'm sure he would like to sort it out in case his PHP is the cause of your problem.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Fri, 07/20/2018 - 11:47
theRiyazSaifi

I am getting same error i am using fast CGI php7 ubuntu16.4 any solution?

Wed, 07/10/2019 - 21:42 (Reply to #15)
kurtobando
kurtobando's picture

have the same behavior on my ubuntu16.4, it returns the error after 31ms in google dev console. I tried to increase the execution time to 600s via server configuration > website option. it works!.