I have a Magento 1.9 shop on a Ubuntu server - it has run without any problems for about a year. When I now open /cron.php in my Chrome browser, I get the following error: ERR_EMPTY_RESPONSE
I have looked into my apache errors log. It says:
[core:notice] [pid 1992] AH00051: child pid 2083 exit signal
Segmentation fault (11), possible coredump in /etc/apache2
... everytime when I try to load the cron.php script.
My syslog shows the following error:
kernel: [ 774.131560] php[2406]: segfault at 7ffc036eceb8 ip
00007f7c1fd7a55a sp 00007ffc036eceb0 error 6 in
libpcre.so.3.13.1[7f7c1fd67000+3d000]
I've found out, that the error occurs at a recursive function in my php script. The function looks quite ok to me.
It turned out that the PHP script had a recurive function with an infinite loop under certain conditions. I would have thought this would just lead to a script timeout. Maybe someone can explain in detail...
Related
I've an apache2 + php7 server running a simple wordpress blog.
The blog ran all the time with apache + mod_php + php7, but recently the during some access peak the system was crashing, getting to slow and even breaking.
So I googled how to optimize the configurations and many tutorials said mod_php is slow and I should replace it for php-fpm.
I did and after the change the site was noteciable faster, but now it randomly crashes and start presenting http 500 error...
There is no obvius reason for the new crashes, no users peak or any other situation I could notice.
the apache error log is plent of:
[fastcgi:error] [pid 37179] [client 162.158.167.177:26270] FastCGI: incomplete headers (0 bytes) received from server "/usr/lib/cgi-bin/php-fcgi"
[fastcgi:error] [pid 37176] (104)Connection reset by peer: [client 103.22.200.111:25406] FastCGI: comm with server "/usr/lib/cgi-bin/php-fcgi" aborted: read failed, referer: http://www.fqn.com.br/wordpress/wp-content/plugins/jetpack/css/jetpack.css
there are really thousands of errors like this, every two seconds one error and i dont understand.
First why is apache asking a css to the fpm?
Second what "/usr/lib/cgi-bin/php-fcgi" is supposed to be? there is no file in this folder!! what is supposed to be there?
The log of php-fpm is tottaly useless, I enabled the DEBUG level of loggind and what I get is just:
DEBUG: pid 1664, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 1 active children, 2 spare children, 3 running children. Spawning rate 2
every second one status message like this and at random intervals some:
WARNING: pid 1664, fpm_children_bury(), line 252: [pool www] child 38554 exited on signal 11 (SIGSEGV) after 58.797353 seconds from start
but no stack trace or detailed error message to help me to understand. I really liked the performance of apache + fpm and didn't want to roll back to mod_php, but it's impossible to run the system for 12h without crashes in the current configuration.
the bellow link shows the php_info page of the server
https://jpst.it/11FIP
does someone have an idea?
It is a programming fault.... somewhere in the php engine
and it seems to be invoked by a program setting it's input to non-blocking or stopping too soon after starting.
(exec(), shell_exec(), proc_open() which fail)...
It seems the PHP developers are not very eager, to put it mildly, to solve the issue. It has been known to exist for YEARS (2012 is the oldest ticket I have seen)
https://bugs.php.net/bug.php?id=73056
I am working on a project developed with laravel 4.2 on ubuntu 14.04 with php 5.5.9 and apache2 ..it was working normally then i faced a strange problem which is when i type localhost/projectname the firefox browser redirects me to www.localhost.com/projectname with a message 'Server not found'. When I checked the apache log I found this message:
[core:notice] [pid 1309] AH00051: child pid 7040 exit signal Segmentation fault >(11), possible coredump in /etc/apache2
I reviewed all the related questions on stackoverflow, but all didn't help.
also note that all other projects are working fine except this one
I just tried to install the PHP SDK on my Ubuntu 14.04.
I started with the C SDK, then isntalled the PHP SDK with pecl.
Everything works fine, i got no errors, a couchbase.so is installed in /usr/lib/php55/…
But when i add a
extension=couchbase.so to my php.ini everything broke, i can't display any php page.
I checked the logs and see:
[Wed Jan 20 11:36:39.872396 2016] [core:notice] [pid 4265] AH00052: child pid 4298 exit signal Segmentation fault (11)
Looks bad uh ?
Any tips to make this works?
I mentioned this to the project maintainer this morning and his hypothesis is that PHP may have had a change in 5.5 that has lead to the breakage as he's seen this sort of thing in the past. Perhaps you can try an older version or get more info per the comment on backtraces above.
When performing a specific action* in a Drupal 7 project, I get the following error in /var/log/apache2/error.log:
[Fri Jun 26 09:53:55.307644 2015] [core:notice] [pid 1553] AH00051: child pid 9998 exit signal Segmentation fault (11), possible coredump in /etc/apache2
Except that when using the step by step function of Xdebug, it doesn't crash.
And when using xdebug.auto_trace=ON, it doesn't crash either.
What could cause a segmentation fault in PHP, except when using Xdebug?
*: The error occurs when sending an email, but only when the recipient is the currently logged in user.
By putting log messages in the code, I've been able to determine that the crash occurs when autoloading the MailMIME class.
In includes/bootstrap.inc, in the _registry_check_code function, if I put the following code:
if($type == 'class' && $name == 'MailMIME')
{
file_put_contents('/tmp/log.txt', "DEBUG 01\n", FILE_APPEND);
}
before line 3147, which is:
$file = Database::getConnection('default', 'default')->query("SELECT filename FROM {registry} WHERE name = :name AND type = :type", array(
':name' => $name,
':type' => $type,
))
->fetchField();
then, I can see "DEBUG 01" in my log file, and it crashes.
However, if I put the same code after the lines 3147 to 3151, it stops crashing...
EDIT: I am able to reproduce the bug on my Ubuntu 14.04 machine with PHP 5.5, but I can't reproduce it on a Windows machine with PHP 5.6.
I have a class file which has some buggy code e.g
else{
$stp->Object($a);
$abbr = $a->abbr;
}
asdf
}
My understanding is that php should properly display an error message e.g saying sth that "asdf" is not a class or constant etc . But as I see this peice of code crashes the server with segmentation fault , as my error log file says:
[Fri Mar 08 17:21:37 2013] [notice] child pid 8615 exit signal Segmentation fault (11)
Is it possible to configure php/apache to properly handle these errors ?
Why php is failing to report the error some understandable way . I only see "The connection was reset"
message in browser.
Specification:
XAMPP (php 5.3.1)
MAC OS 10.6
Xdebuger installed
Apparently something is going wrong into Apache, so it can't be properly displayed because the Apache child exit.
I had some similar error once because the PHP error made a redirection to a PHP error file (ex: ErrorDocument 500), which contained the same error, so it redirect to the PHP error page and so on... making a redirection loop.
Apache kill itself to avoid the machine to go down.
You have to diagnose what is making Apache die.
To do this, install "strace", eg. on debian :
apt-get install strace
Then stop your Apache, and start it through strace :
strace -f /usr/sbin/apache2ctl
Reproduce your problem until your Apache child crash, and try to look into the strace log to find out what happened.
Hope this helped.