Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have removed everything , and reinstalled apache 2. and it works.

But if i install libapache2-mod-php5 then apache stops working.

If i again remove that libapache2 ... then again apache starts working

What should i do

Ubuntu 9.10

This the error in log file of apache error

PHP Warning:  [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.6-3ubuntu4.4. Rebuild it for your PHP version (5.2.10-2ubuntu6.4) or download precompiled binaries.\n in Unknown on line 0
PHP Fatal error:  Unable to start eAccelerator module in Unknown on line 0
share|improve this question
    
Can you provide more information? Symptoms, log messages, ect? –  Brian Tillman Apr 13 '10 at 7:18
2  
I'd say disabling eAccelerator would be a good start to troubleshooting. Closely followed by "Rebuild it for your PHP version (5.2.10-2ubuntu6.4) or download precompiled binaries." –  micmcg Apr 13 '10 at 8:01

2 Answers 2

up vote 1 down vote accepted

Did apache2 fail to start? Do you have eaccelerator installed? Did you recently upgrade php5? If so, I may have the answer to your problem.

It all started when I upgraded some packages on a Ubuntu server through Webmin. I think one of the packages was php5.

Anyhow, seeing that I upgraded packages related to Apache2, I restarted the apache2 service. It was then that I was met with the following error message:

 1.
      Failed to start apache :
   2.

   3.
       * Starting web server apache2
   4.
      (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
   5.
      no listening sockets available, shutting down
   6.
      Unable to open logs
   7.
         ...fail!

So it seems that apache2 couldn't start because the address was already in use.

Believing that the error might have been a result from starting apache2 from Webmin, I opened up a console window and tried to start apache2 from the command line with

 1.
      sudo /etc/init.d/apache2 restart

Still, apache2 didn't start and I was shown the following error message:

   1.
      * Restarting web server apache2
   2.
      httpd (no pid file) not running

What seemed kind of odd though, was that when I ran the top command, it showed that the apache2 process was running and using 100% of cpu.

The next place to turn was apache's error logs located at

  1.
      /var/log/apache2/error.log

The error log showed the following message that indicated eaccelerator might have been related to the problem of apache2 not starting:

   1.
      PHP Warning:  [eAccelerator] This build of "eAccelerator" was compiled for PHP version 5.2.4-2ubuntu5.3. Rebuild it for your PHP version (5.2.4-2ubuntu5.4) or download precompiled binaries.\n in Unknown on line 0
   2.
      PHP Fatal error:  Unable to start eAccelerator module in Unknown on line 0

A little google searching showed me that eAccelerator wasn't working because it's not compiled for my newly upgraded version of php5.

To remedy the situation, or at least to confirm whether or not eaccelerator was the problem, I renamed the eaccelerator.ini file stored in

   1. /etc/php5/apache2/conf.d   to something else and then started apache2.

Apache started up as if there was never any problem. It was eaccelerator keeping apache from starting.

Apache2 worked as long as eaccelerator wasn't active. Now all I'll need to do if I want to continue using eaccelerator is to recompile eaccelerator so that it is compatible with my upgraded version of php5.

share|improve this answer
    
wow , excellent , thanks buddy –  John Apr 13 '10 at 23:46

Do you get some log output from the attempt to start apache with php?

Possible locations are /var/log/messages, /var/log/syslog and /var/log/apache2/error.log

If yes, please add it to your question.

share|improve this answer
    
i don't get error on command prompt but i see some stuff in log . i have edited the post –  John Apr 13 '10 at 7:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.