I spent much time to figure out why apache2 crashes. My environment is:
- Debian Testing
- Apache 2 (rewrite, ssl, etc)
- PHP 5.3 Zend installed from zend repo
Nothing unsual, but dmesg says:
apache2[xxxx]: segfault at 18 ip xxxx sp xxxx error 4 in libphp5.so[xxxxx]
There is nothing else in logs I found and it is very difficult to find the problem.
I’ve started discover problem from php modules, because much segmentation faults relates to php module. After few tests I found that disabling module curl fixes the problem. But in my case curl is required, so I have to continue investigation.
The one important think that php-cli with curl enabled works ok and php -m too.
So definitely it is apache’s problem. Hour later I’ve discovered that with disabled ssl and enabled curl apache works.
There is an conflict in two modules (mod_ssl, php_curl). And
ldd mod_ssl.soshow that this library depends onlibcrypto.so.1.0.0. Actually aptitude shows me that version of openssl is 1.0.0-e. But phpinfo() shows me that it built with--with-openssl=/usr/local/openssl-0.9.8o. There is conflict. There are two modules depends on openssl but built with different versions: 0.9.8o vs 1.0.0-e!I had to downgrade my version of apache2 and openssl to appropriate version and now it works: ssl and curl both.
Because it was difficult to figure out this problem I’ve decided to post this tip here. And I hope this little note helps somebody to save some time.