Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Apache to run PHP

Status
Not open for further replies.

mufka

ISP
Dec 18, 2000
587
US
When I add the LoadModule to my httpd.conf, and restart, I get the following
error:

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

the lines in the httpd.conf are:
LoadModule php3_module /usr/lib/apache/libphp3.so
AddModule mod_php3.c

These are the lines that the php-3.0.17 install put in.
I am thoroughly baffled.

I am using Apache 1.3.9 on RedHat 6.1.

Thanks for any help
 
Most likely, mod_so is not compiled into your Apache install. This module is required to use the DSO (LoadModule) features of Apache.

Try to recompile using the --enable-shared=php3 option in your configure statement. That will automatically install mod_so.

Or you can statically compile PHP into httpd. To do this, when you configure PHP, use the --with-apache=/path/to/apache-source-directory option, and when configuring Apache, use the --activate-module=src/modules/php3/libphp3.a and --enable-module=php3 options.

Good luck,

brendanc@icehouse.net
 
The LoadModule option has to be in there already because there are other LoadModule commands in the conf. I've compiled PHP with the --with-apache=/path/to/apache-source-directory option. I'm not sure I know where the --activate-module=src/modules/php3/libphp3.a and --enable-module=php3 options go. (I don't have a libphp3.a anywhere) Do these options go in the httpd.conf?

Thanks

 
The LoadModule directive is only for shared objects (DSOs). These are modules that are loaded on top of httpd rather than as part of httpd. This concept is opposite static compiling...

When you compile Apache (this is assuming that you are using the source tar.gz file instead of the RPMs), you go through the following process:

./configure
make
make install

In that first command is where you place the options I have mentioned above.

libphp3.a is a file that will be created during the make process from libphp3.module. You should have that in your Apache source tree in the src/modules/php3 directory.

I wrote a tutorial on Apache installation/setup a while back... It's available at
Hope this helps,

brendanc@icehouse.net
 
Thanks. That procedure looks great. i've gone through most of it and have been relatively successful. But when I go to make Apache i get the following.

/usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function `my_uncompress':
my_compress.o(.text+0x97): undefined reference to `uncompress'
/usr/local/mysql/lib/libmysqlclient.a(my_compress.o): In function `my_compress_alloc':
my_compress.o(.text+0x12b): undefined reference to `compress'
collect2: ld returned 1 exit status
make[2]: *** [target_static] Error 1
make[2]: Leaving directory `/root/dl/apache_1.3.12/src'
make[1]: *** [build-std] Error 2
make[1]: Leaving directory `/root/dl/apache_1.3.12'
make: *** [build] Error 2


This RedHat 6.1 box already had a working copy of the RPM version of Apache 1.3.9. Am I going about this wrong to add the PHP and MYSql support? Which tree should I bark up next?

Thanks for the help.

 
Those are linker errors... Typically means that the program "ld" isn't finding one of the libraries necessary to put the program together. Look for errors right before those that look like:
ld: cannot find -l<some library name>
If you see one of these, the missing file is most likely called lib<some library name>.a, so go to your root directory and issue a &quot;find -iname 'thatfile.a'&quot; where thatfile is the missing lib. Once you establish the directory that the library is in, go into the directory that you last saw in the make results (something like &quot;Switching to <directory>&quot;. Edit the Makefile, and toward the top, on the line EXTRA_LDFLAGS=, add &quot;-L/path/to/library&quot; leaving the quotes off as well as the actual library name.

Now.. if you didn't see &quot;ld: cannot find etc...&quot;, you're in for a bit more work. We'll hope that isn't the case.

Good luck,

brendanc@icehouse.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top