Apache 1.3.26 and PHP 4.2.1
| From: | Rob Dulce | Date: | Fri, 28 Jun 2002 21:48:08 +0000 |
| Subject: | Apache 1.3.26 and PHP 4.2.1 | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-7526@lists.php.net to get a copy of this message | ||
Hello everyone,
I needed to upgrade apache 1.3.24 to 1.3.26. The old apache was using PHP 4.1.2, so I decided to
upgrade PHP, too. I failed to upgrade PHP, but I did get the new apache to use 4.1.2, so I am
relieved. But I want to know what I did wrong with 4.2.1. I followed the instructions in the install
file. I think the problem has to do with how I upgraded apache. Let me explain: Apache was currently
installed in /usr/local/etc/apache. I untared 1.3.26 in /usr/local/build/. So I now had this
directory: /usr/local/build/apache_1.3.26/. This is the same directory that I decided to compile the
source in. In other words, I compiled apache using --prefix=/usr/local/build/apache_1.3.26/. After I
compiled apache, I then removed the htdocs directory and created a symlink called htdocs that
pointed to /usr/local/etc/apache/htdocs. I did all of this, because I wanted to stop the current
httpd binary and start the new one to see if things worked. If things didn't work, I could
easily stop the new httpd file and start the old one, again. At this point, though, I had not
started the new binary, yet. The current server was still running. I now untared PHP 4.2.1 in
/usr/local/build and read the install file, which states for quick install (DSO):
"For this to work your Apache httpd must have mod_so enabled.
$ gunzip -c php-4.1.x.tar.gz | tar xf -
$ cd php-4.1.x
$ ./configure --with-mysql --with-apxs
$ make
$ make install
If you get an error telling you that the apxs script could not be found,
look for it on your system and if you find it, provide the full path to it
as: --with-apxs=/path/to/apxs
Next you must copy php.ini-dist to the appropriate place (normally
/usr/local/lib/php.ini) and edit it as necessary to set PHP options.
The only thing left to do is to edit your httpd.conf file and make sure the
PHP 4 mime type is there and uncommented. You need a line that looks like
this: AddType application/x-httpd-php .phpThen restart your server (apachectl restart) and you
should be able to
serve up PHP files now."
Okay, I built apache 1.3.26 with mod_so enabled. So I figured that all I had to do was compile PHP
using --with-apxs=/usr/local/build/apache_1.3.26/bin/apxs. This is exactly what I did. Following
the install file, I then copied php.ini-dist to /usr/local/lib. I saved the old php.ini and renamed
php.ini-dist to php.ini. I then edited httpd.conf in /usr/local/build/apache_1.3.26/conf. I added
the line: AddType application/x-httpd-php .php. Again, I was following what the install file was
telling me to do -- word for word. I stopped the httpd binary in /usr/local/etc/apache/bin. I then
started the other httpd binary in /usr/local/build/apache_1.3.26/bin. The web server (apache_1.3.26)
was up and running. I felt good, but then when I went to a .php file under htdocs, a download window
appeared. Apparently, apache did not load the php module. To fix the problem I added this line to
the httpd.conf file:
LoadModule php4_module /usr/local/etc/apache/libexec/libphp4.so
Of course, this was the old module (4.1.2). I restarted the server (1.3.26), and everything worked
fine. I could view php files under htdocs. My question is: What did I do wrong for PHP 4.2.1 not to
work. I did not compile apache_1.3.26 with php support. In other words I did not use
--activate-module=src/modules/php4/libphp4.a. But according to the PHP install file, I could still
load the PHP module as long as I enabled mod_so. Thanks for the help!
---------------------------------
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup