Easyapache: httpd failed when upgrading to PHP5

headout

Well-Known Member
Aug 20, 2003
78
0
156
Hi,

we tried to upgrade our PHP version from 4.4.7 to 5.2.4. The upgrade seems succesfull, but httpd doesn't come up. It fails, even with a restart through SSH.

WHM 11.11.0 cPanel 11.15.0-R17665

s03# /usr/local/apache/bin/apachectl configtest
Syntax OK

No specific errors in the Apache error log.

A downgrade tot PHP4 is necessary to let Apache restart.
 

mtindor

Well-Known Member
Sep 14, 2004
1,452
110
193
inside a catfish
cPanel Access Level
Root Administrator
Hi,

we tried to upgrade our PHP version from 4.4.7 to 5.2.4. The upgrade seems succesfull, but httpd doesn't come up. It fails, even with a restart through SSH.

WHM 11.11.0 cPanel 11.15.0-R17665

s03# /usr/local/apache/bin/apachectl configtest
Syntax OK

No specific errors in the Apache error log.

A downgrade tot PHP4 is necessary to let Apache restart.
Did non-php sites come up? Depending on whether you are running suexec / suphp or not, you should also check all of the following logs:

/usr/local/apache/logs/error_log
/usr/local/apache/logs/suexec_log
/usr/local/apache/logs/suphp_log
/usr/local/apache/logs/audit.log (if running mod_security)
/usr/local/apache/domlogs/nameofdomain.ext (obviously replace that)

And check /var/log/messages

There are definitely going to be errors _somewhere_, in at least _one_ of those files. And without reading the errors you'll probably never know why it didn't come up.

If it was specific to just PHP sites, it probably was an issue with AddType / AddHandler lines in php.conf or something.

Mike
 

headout

Well-Known Member
Aug 20, 2003
78
0
156
Today httpd failed, and trying to restart through ssh: failed.
The apache errorlog show us nothing more then:
[Thu Oct 25 13:40:00 2007] [notice] mod_security/1.9.5 configured
[Thu Oct 25 13:40:01 2007] [notice] mod_security/1.9.5 configured
[Thu Oct 25 13:40:29 2007] [notice] mod_security/1.9.5 configured
[Thu Oct 25 13:41:01 2007] [notice] mod_security/1.9.5 configured
[Thu Oct 25 13:41:02 2007] [notice] mod_security/1.9.5 configured

The other logs are empty or don't show important messages.

In /var/log/messages we see this:
Oct 25 13:18:40 s03 kernel: pid 93646 (httpd), uid 0: exited on signal 11 (core dumped)

When we downgrade to PHP4, hhtpd restarts.
When we use these settings:
Default PHP Version (.php files) 5
PHP 5 Handler cgi
PHP 4 Handler dso
Suexec off
It all works fine.

But switching back to PHP5 as dso and PHP as cgi, httpd fails and showing us the same errors as above.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
79
458
cPanel Access Level
Root Administrator
What happens when you execute PHP 5 via the command line? e.g. /usr/bin/php or /usr/bin/local/bin/php

Don't pass any parameters/flags, just execute the command. If it returns immediately, then something is likely causing a seg fault. If the system waits for extra info, then the binary and it's libraries are likely fine. Returns immediately means after typing /usr/bin/php and hitting enters, the command prompt re-appears. If the command prompt does not re-appear without depressing CTRL+C then the binary should be fine.

If you are using any 3rdpary extensions: Zend Opt, Ion Cube, eAccelerator, try disabling them.

Which version of Apache are you using?
 

headout

Well-Known Member
Aug 20, 2003
78
0
156
If the command prompt does not re-appear without depressing CTRL+C then the binary should be fine.
Indeed, that happens. I need to press ctrl + F5 to get the prompt back.

Apache version: 1.3.39; we run PHP with the Zend Engine.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
79
458
cPanel Access Level
Root Administrator
Indeed, that happens. I need to press ctrl + F5 to get the prompt back.

Apache version: 1.3.39; we run PHP with the Zend Engine.
Did you examine the core dump?

PM me the output of php -i (or phpinfo() ) and I'll examine it for any oddities.

We might need to have you open a support ticket at https://tickets.cpanel.net/submit/ to get full resolution.
 

Lestat

Well-Known Member
Sep 13, 2003
199
0
166
/usr/local/apache/logs/error_log
[Wed Nov 14 15:40:04 2007] [emerg] (43)Identifier removed: couldn't grab the accept mutex
[Wed Nov 14 15:40:04 2007] [emerg] (43)Identifier removed: couldn't grab the accept mutex
[Wed Nov 14 15:40:04 2007] [emerg] (43)Identifier removed: couldn't grab the accept mutex
[Wed Nov 14 15:40:04 2007] [emerg] (43)Identifier removed: couldn't grab the accept mutex
[Wed Nov 14 15:40:04 2007] [emerg] (43)Identifier removed: couldn't grab the accept mutex
[Wed Nov 14 15:40:04 2007] [emerg] (43)Identifier removed: couldn't grab the accept mutex
[Wed Nov 14 15:40:04 2007] [emerg] (43)Identifier removed: couldn't grab the accept mutex
[Wed Nov 14 15:40:05 2007] [emerg] (22)Invalid argument: couldn't release the accept mutex
[Wed Nov 14 15:40:05 2007] [alert] Child 5817 returned a Fatal error... Apache is exiting!
[Wed Nov 14 15:40:09 2007] [emerg] (22)Invalid argument: couldn't grab the accept mutex
[Wed Nov 14 15:40:12 2007] [emerg] (22)Invalid argument: couldn't grab the accept mutex
[Wed Nov 14 15:44:10 2007] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)
[Wed Nov 14 15:44:10 2007] [notice] ModSecurity for Apache 2.1.3 configured
[Wed Nov 14 15:44:11 2007] [notice] mod_bw : Memory Allocated 0 bytes (each conf takes 28 bytes)
[Wed Nov 14 15:44:11 2007] [notice] mod_bw : Version 0.8 - Initialized [0 Confs]
[Wed Nov 14 15:44:11 2007] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Wed Nov 14 15:44:11 2007] [notice] Apache/2.2.6 (Unix) mod_ssl/2.2.6 OpenSSL/0.9.7a mod_bwlimited/1.4 mod_auth_passthrough/2.1 FrontPage/5.0.2.2635 configured -- resuming normal operations



My httpd crashes about every 2-3 hours..... not sure what is causing it..
 

Bulent Tekcan

Well-Known Member
May 11, 2004
185
2
168
cPanel Access Level
Root Administrator
Same problem here sometimes I see in this error my logs

[emerg] (22)Invalid argument: couldn't grab the accept mutex

When I update apache to 2.2.6 this problem started.I never see any error apache 1.3.x

Any idea ?