Web Hosting Talk







View Full Version : Compile PHP4 into Apache


Skeptical
01-28-2002, 07:33 AM
I have a server running cpanel and apache, but don't have php4. I want to compile php4 for apache, but I have some non-standard mods for apache, such as mod_bwlimited, mod_frontpage, mod_log_bytes.

How do I compile php4 and not have to mess with those other mods? I've done this with no success:

[#]cd /backup/stuff/php-4.1.1/
[#]./configure --prefix=/usr/local/lib/php --with-config-file-path=/usr/local/lib --with-mysql --with-apache=../apache_1.3.23 --enable-track-vars --enable-debugger --enable-magic-quotes
[#]make
[#]make install
[#]cd ../apache_1.3.23/
[#]./configure --prefix=/usr/local/apache --activate-module=src/modules/php4/libphp4.so --add-module=src/modules/standard/mod_so.c --enable-module=rewrite --enable-shared=mod_ssl.so --enable-shared=mod_frontpage.so --enable-shared=mod_log_bytes.so --enable-shared=mod_bwlimited.so
[#]make
[#]make install
[#]/usr/local/apache/ctl configtest

I get the following error:
API module structure `bwlimited_module' in file /usr/local/apache/libexec/mod_bwlimited.so is garbled - perhaps this is not an Apache module DSO?


HELP???

allera
01-28-2002, 08:18 AM
Are you compiling the same Apache version as the version mod_bwlimited.so was compiled for? If not, you'll have to recompile all your .so files for the new version of Apache (1.3.23 it seems).

I remember having this type of problem before, but I'm not sure if that was the error I got or not; it looks familiar. Thought I'd mention it anyway in case it was of any use...

Skeptical
01-28-2002, 09:54 AM
I just did this and it worked:

./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local/lib/php --with-config-file-path=/usr/local/lib --enable-track-vars --enable-debugger --enable-magic-quotes

make

Then I copied the php4.so file "make" created into my libexec folder and viola now it works!

However, I'd like to put a path to "--with-mysql" because when I did the make it ended with a warning that if I wanted to use mod_perl and it utilizes mysql I'd need to add in the path.

Where do I find this path for the headers? I typed "whereis mysql" and put in ALL of the listed results in as the value with no success.

Help?