Page 1 of 1

PHP install problem: LoadModule does not work in httpd.conf

Posted: Wed Mar 26, 2003 1:26 pm
by Hef
Hi everyone

I'm installing PHP for the first time on a linux box and I've run into some problems. I basically followed the directions on http://cvs.php.net/co.php/php4/INSTALL and I'm almost at the end the install process but now i've run into problems.

the php install adds a line in the httpd.conf file on line 173:

LoadModule php4_module module/libphp4.so

when I restart apache using httpd restart, I get a error when it comes to this line:

Syntax error on line 173 of /etc/httpd/conf/httpd.conf:
Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not included in the server configuration

whats wrong? there are other uncommented LoadModules calls in the httpd.conf file and they all work fine. just that new line gives it problems.

I recently had to take over duties on this linux box so I can't say much about what else is installed on the system. all i know is that its running linux 6.x and some version of apache. apache does run fine if I use the old httpd.conf

any ideas? help is greatly appreciated

Posted: Thu Mar 27, 2003 2:59 am
by volka
strange. I'm only guessing.

Locate the apache executable (for me it's /usr/sbin/apache but it can be almost anywhere) and execute apache -l. This should list the built-in modules. Make sure mod_so.c is listed. (apache -V should list the compile configurations)

If there's a directive for mod_info.c in httpd.conf uncomment it and also the <Location /server-info> section. change the Allow from-line to something appropriate (e.g. 192.168.0 if this fits your intranet settings). Restart apache and try to access http://<server>//server-info. Take a look at the configuration. Make sure there's neither a php-module already loaded nor a php-cgi version. A mod_php package ships with most linux distributions.

Delete the LoadModule php4_module line from your httpd.conf and retype it manually in an editor on this box (not via smb-share and win32-editor). Check wether there really is a module directory containing libphp4.so in your apache directory.

btw: there is no linux version 6.x. You're refering to the distribution's version number. Execute uname -a in a console to get more detailed informations on your linux base system.

Posted: Thu Mar 27, 2003 6:38 pm
by Hef
thanks for all your suggestions, however I still can't get it to work

instead of using apache -l, I used httpd -l. With that command I get:
Compiled-in modules:
http_core.c
mod_so.c

I'm assuming thats the same as running apache -l? my httpd executable is also in /usr/sbin. however I don't have an apache executable

Is there any way to find where my apache directory is? Like I said its already installed before my work on it. I see libphp4.so in lots of directories, but I don't know if any of them is the directory for apache. The apache version is 1.3.9. It does serve up cgi quite nicely

I welcome any suggestions. at this point i'm willing to try anthing

Posted: Fri Mar 28, 2003 12:51 am
by volka
oops, I'm not such a good admin ;)
yes, httpd is the common name, gentoo-linux just renames it to apache.
If you call httpd -V is there a directive -D HTTPD_ROOT="/a/path" ?
then if there is something like LoadModule php4_module module/libphp4.so in httpd.conf it will lookup libphp4.so in /a/path/module/libphp4.so
If you can enable mod_info.c http://<server>/server-info shows that information, too
Server Version: Apache/1.3.27 (Unix) (Gentoo/Linux)
...
Server Root: /etc/apache
Config File: conf/apache.conf
PID File: /var/run/apache.pid
...