LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache won't restart after install of PHP [Fedora 15, 64-bit] (https://www.linuxquestions.org/questions/linux-newbie-8/apache-wont-restart-after-install-of-php-%5Bfedora-15-64-bit%5D-904449/)

cheddarcheese 09-22-2011 11:02 AM

Apache won't restart after install of PHP [Fedora 15, 64-bit]
 
Hi,

I've had Apache 2.x running on my Fedora 15 box for a while, and it's been perfect. However, today I figured it would be good to put PHP on the machine too. So, I yummed php and a bunch of php modules onto the machine, which all installed with no problem. Having changed no config files, I went to restart Apache:

Code:

# /sbin/service httpd start
Starting httpd (via systemctl):  Job failed. See system logs and
'systemctl status' for details.
                                                          [FAILED]

"systemctl status" didn't tell me anything (except that there are too few arguments), and "systemctl dump" wasn't enlightening either. I checked the Apache error log, and there is only one error in there from today - although nothing in there from trying to start up: (I'm pretty sure this is from when I first issued an httpd restart)

Code:

[Thu Sep 22 11:37:35 2011] [notice] caught SIGTERM, shutting down
The only thing in /var/log/messages is the following, each time I attempt to restart:

Code:

Sep 22 11:47:19 dbserver systemd[1]: httpd.service: control process exited, code=exited status=1
Sep 22 11:47:19 dbserver systemd[1]: Unit httpd.service entered failed state.


I did the exact same PHP install on a Fedora 12 box yesterday and it worked perfectly. I would appreciate some suggestions as to how to get Apache up and running again. (ideally without rebooting the machine, because it's being used as a database server by other machines).

Thanks!

bathory 09-22-2011 11:55 AM

Hi,

You should use:
Code:

systemctl status httpd.service
I noticed that you used:
Quote:

/sbin/service httpd start
You should restart the service, as I guess it was already running
Code:

/sbin/service httpd restart
Regards

cheddarcheese 09-22-2011 12:05 PM

Thx for the systemctl info' - I wasn't sure how to use it properly. httpd is already stopped now anyway, so I guess start or restart won't make too much difference at the moment. The info for httpd from systemctl is as follows:

Code:

# systemctl status httpd.service
httpd.service - LSB: start and stop Apache HTTP Server
  Loaded: loaded (/etc/rc.d/init.d/httpd)
  Active: failed since Thu, 22 Sep 2011 12:57:28 -0400; 2min 40s ago
  Process: 14175 ExecStop=/etc/rc.d/init.d/httpd stop (code=exited, status=0/SUCCESS)
  Process: 6746 ExecReload=/etc/rc.d/init.d/httpd reload (code=exited, status=0/SUCCESS)
  Process: 14695 ExecStart=/etc/rc.d/init.d/httpd start (code=exited, status=1/FAILURE)
  Main PID: 2367 (code=exited, status=0/SUCCESS)
  CGroup: name=systemd:/system/httpd.service

It doesn't mean too much to me, but if you're able to suggest something based on the above, then that would be much appreciated.

FYI. There are no PHP modules being told to load in httpd.conf

cheddarcheese 09-22-2011 12:22 PM

Hmmm. I now have it working again, by virtue of editing /etc/rc.d/init.d/httpd. However, it's not ideal, since it means I'm running prefork, when I really want to run worker.

I'd changed /etc/rc.d/init.d/httpd a while back, such that the line

Code:

httpd=${HTTPD-/usr/sbin/httpd}
read, instead:

Code:

httpd=${HTTPD-/usr/sbin/httpd.worker}
... since both were on the system, and worker tends to be faster than prefork. This was working fine, but it now looks like only prefork will work, for some reason. Any clues appreciated, as I would much prefer to be running worker Apache. Thanks again!

bathory 09-22-2011 12:46 PM

Quote:

FYI. There are no PHP modules being told to load in httpd.conf
The module is loaded by /etc/httpd/conf.d/php.conf

Anyway looks like the php module has problems with apache running with mpm worker. You only chance it to run it as a fastcgi if you absolutely want to run apache as mpm worker.

cheddarcheese 09-22-2011 01:18 PM

Thanks for the point in the right direction. I have managed to get it all running again now with worker Apache, and PHP. Looking at the /etc/httpd/conf.d/php.conf file, I could see that there was a module missing for worker in /modules. So, per the info' at http://www.jqueryin.com/2010/08/07/s...-5x-fedora-13/ I installed the php-zts module:

Code:

yum install php-zts
Anyway, it's all up and running again now as I wanted, with PHP and worker Apache. Thanks very much for your suggestions!


All times are GMT -5. The time now is 12:19 PM.