Solved: Apache 2.0.43 and php 4.3.0-dev on Linux

12 views
Skip to first unread message

daneanderson

unread,
Oct 18, 2002, 7:32:19 PM10/18/02
to
For the archives, here's how I got Apache 2 and PHP working together on Linux
(RedHat 7.3). For future Apache versions, make sure you choose a version of
Apache released BEFORE the php release. Using an Apache 2 released after a
PHP will probably not work.

I was only able to get PHP working with Apache 2 as a DSO.
I think that's the only way that's supported now.

I used httpd-2.0.43 and php-4.3.0-dev (php4-200210181200)
(from http://snaps.php.net/php4-latest.tar.gz )
php-4.3.0pre1 mostly worked, but my messages with Phorum (PHP app) were garbled
(probably a php/mysql bug).
I'm sure that fix will appear in the next prerelease of php-4.3.0 (pre2?).

0. Download/unpack Apache2 source.

1. In the Apache 2 source directory, type:
./configure --prefix=/usr/local/apache \
--enable-so \
--enable-cgi \
--enable-info \
--enable-rewrite \
--enable-speling \
--enable-usertrack \
--enable-deflate \
--enable-ssl \
--enable-mime-magic
make

2. If successful, install, as root:
make install
3. In the php source directory, type:
./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql \
--prefix=/usr/local/apache/php \
--with-config-file-path=/usr/local/apache/php \
--enable-track-vars \
--enable-force-cgi-redirect \
--with-gettext \
--with-gdbm
make

5. If successful, type, as root: make install-su
4. cp -p php.ini-recommended /usr/local/apache/php/php.ini
5. Make sure libs/libphp4.so is in /usr/local/apache/modules/
If not, copy it there)
6. Verify (and add if missing) these directives in
/usr/local/apache/conf/httpd.conf:

# Make sure there's only **1** line with this directive:
LoadModule php4_module modules/libphp4.so

# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php

AddType application/x-httpd-php php

7. Start httpd:
/usr/local/apache/bin/apachectl start
8. Sanity checks:
ps -ef |grep httpd
tail /usr/local/apache/logs/error_log
/usr/local/apache/bin/httpd -v
/usr/local/apache/bin/httpd -V
/usr/local/apache/bin/httpd -l
/usr/local/apache/bin/httpd -t
9. Access your webserver with your favorite browser.

Reply all
Reply to author
Forward
0 new messages