Web server offline after php4 and apache2 upgrade

Discussion in 'Installation/Configuration' started by dfriis, Sep 6, 2006.

  1. dfriis

    dfriis New Member

    I wanted to upgrade the apache and php version on my debian sarge installation and followed the instructions at http://www.howtoforge.com/forums/showthread.php?t=1257&highlight=upgrade mysql

    I didn't change the file sources.list though, I just did an apt-get update first to check if there were any updates for me, and there was.

    I'm not sure what it did upgrade though but when I try to start apache I get:

    www:/var/log/httpd# /etc/init.d/apache2 restart
    Forcing reload of web server: Apache2 ... failed!
    You may still have some apache2 processes running.  There are
    processes named 'apache2' which do not match your pid file,
    and in the name of safety, we've left them alone.  Please review
    the situation by hand.
    Syntax error on line 48 of /etc/apache2/vhosts/Vhosts_ispconfig.conf:
    Invalid command 'php_admin_flag', perhaps mis-spelled or defined by a module not included in the server configuration
    The only thing I wrote was:
    apt-get update
    apt-get install mysql-server mysql-client libmysqlclient12-dev
    apt-get install apache2 apache2-doc
    apt-get install libapache2-mod-php4 libapache2-mod-perl2 php4 php4-cli php4-common php4-curl php4-dev php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt curl libwww-perl imagemagick
    I've searched the forums for a while now and the only problem I think I might have is that mod_php isn't loaded. Why is that setting lost and how can I fix it?

    I'm not that confident around apache, php and linux but I'm good at following instructions. It's just a pain in the behind that everything gets messed up as soon as you try to use this friggin' system...

    Please help me, this server is in some sort of production and I have to get it up and running :(
  2. Ben

    Ben HowtoForge Supporter

    The first question is, why apt-get install worked, if you wand to dou an update, because the command herefore is after and apt-get update
    apt-get upgrade.

    It seems that mod_php is not properly installed andy that's why he's telling
    So I would try stop the apache if running, and afterwards take a look with
    ps aux | grep apache if processes of apache are still running.

    If your config still exists, backup it, then I would reinstall all things you wanted to upgrade regarding apache2 and see if that helps...
  3. dfriis

    dfriis New Member

    After reading the above, quoted from the link I posted, I though it was perfectly fine to use the install command. It was fine too, untill the server tried to start the webserver again. It found a few packages to upgrade and did so, there were no errors in the installation procedure what I know of.

    I've rebooted the machine now but I don't seem to get it up and running again. It's a remote server so I have to get back to you with the updates. Have to make a few calls and get people to boot it up for me :)

    Is there no way to install mod_php without reinstalling everything? I just can't see the fun in reinstalling the entire server everytime some upgrade/change mess it up.
  4. dfriis

    dfriis New Member

    Well, the server is up and running again but there is still no working webserver.

    If there is no way to just install mod_php, what is the simplest way to reinstall the packages I tried to upgrade?

    What config files do I HAVE to backup before doing this? Please tell me this is doable without reinstalling the system...
  5. till

    till Super Moderator

    run this commad as root user:

    apt-get install libapache2-mod-php4 libapache2-mod-perl2 php4 php4-cli php4-common php4-curl php4-dev php4-domxml php4-gd php4-imap php4-ldap php4-mcal php4-mhash php4-mysql php4-odbc php4-pear php4-xslt curl libwww-perl imagemagick
  6. fbnewtz

    fbnewtz New Member

    Figured out how to solve this problem

    Just for those people who are desperately trying to figure out what happened after they upgraded and PHP will not work.

    From the /etc/apache2/mods-enabled folder run the following commands
    /etc/apache2/mods-enabled# ln -s /etc/apache2/mods-available/php4.load
    /etc/apache2/mods-enabled# ln -s /etc/apache2/mods-available/php4.conf
  7. falko

    falko Super Moderator

    You can run
    a2enmod php4
    instead. It does the same.
  8. sgrayban

    sgrayban New Member

    Mandriva 2007 & maybe other distros have this issue

    I use mandriva and ran into this crap issue....

    Mandriva likes to make modules of _everything_ for apache and I was getting the same errors and ISPConfig was not loading in new websites because httpd -t was throwing a vail but invalid error.

    The problem begins when you instaall a apache2 module and it installs it into 'modules.d/70_mod_php4.conf' or something like that.

    httpd -t doesn't load that in -- know why ? Cause in Mandriva atleast 1 issue is going on.
    1) httpd -t doesn't check syntax with the included 'Include modules.d/*.conf' still

    So what I had to do was manually add the following into httpd.conf ....

    LoadModule php4_module extramodules/mod_php4.so
    LoadModule suexec_module extramodules/mod_suexec.so

    These two modules _MUST_ be loaded into the main httpd.conf for 'httpd -t' to work. After I did that the error 'Invalid command 'php_admin_flag' went bye bye and all was good.

    The suexec_module will also throw a error if its loaded the same way the php4 module is so I had to add that as well.

    Maybe 'httpd -t' just isn't a good idea until the apache people fix this bug. I already reported it.
  9. falko

    falko Super Moderator

  10. sgrayban

    sgrayban New Member

    That howto for mandriva needs lots of work... Mainly remove all the useless graphics.
  11. till

    till Super Moderator

    They might be useless for you but not for others.
  12. falko

    falko Super Moderator

Share This Page