[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] PHP4 on a RaQ2



>> In the past few days we had 2 threads on the subject :-)... Anyway the
>> solution is bugs.php.net bug ID 9827 if you really want PHP 4.0.4pl1.
>> I did it on a Qube2 and somebody else on a Raq2. I did put together a
>> small howto (for the Qube2), let me know if you want it.
> 
> Judging by the amount of requests on this list, a HOWTO would be very much
> appreciated!

O.K. here's what worked for me. Thanks to Pierre Chopot's bug report I made
the fix to the crypt.c file and now I have PHP4.0.4pl1 compiled into Apache
1.3.19. Let me know if anyone sees any glaring mistakes I might have made.
Remember, use at your own risk, this voids the warranty, YMMV, etc.

Install Apache and PHP
------------------------------

[1] Download Apache:
http://httpd.apache.org/dist/httpd/apache_1.3.19.tar.gz

A mirror list is at:
http://www.apache.org/dyn/closer.cgi

[2] Download PHP:
http://www.php.net/downloads.php

[3] Uncompress Apache and delete the tarball:
tar xvzf apache_1.3.19.tar.gz
rm apache_1.3.19.tar.gz

[4] Uncompress PHP and delete the tarball:
tar xvzf php-4.0.4pl1.tar.gz
rm php-4.0.4pl1.tar.gz

[5] The Raq2 needs mod_auth_pam to be installed with Apache.
Download it:
http://pam.sourceforge.net/mod_auth_pam/dist/mod_auth_pam.tar.gz
tar xvzf mod_auth_pam.tar.gz
rm mod_auth_pam.tar.gz
cd mod_auth_pam-1.0a

[6] Edit the mod_auth_pam.c file.
vi mod_auth_pam.c

Change line 120 so it reads:
*pam_servicename = "ahttpd",

[7] Copy mod_auth_pam into the Apache modules directory:
cp mod_auth_pam.c ../apache_1.3.19/src/modules/extra/

[8] Configure Apache initially:
cd ..
cd apache_1.3.19
./configure --prefix=/etc/httpd

[9] Configure PHP:
cd ..
cd php-4.0.4pl1/ext/standard/
edit the crypt.c file (bug fix - http://www.php.net/bugs.php?id=9827&edit=2)
 
I changed the instance of 10000.0 to 1.0 in these three lines of the crypt.c
file starting at line 109:
#if HAVE_SRAND48
 srand48((unsigned int) time(0) * getpid() * (php_combined_lcg() * 1.0));
#elif HAVE_SRANDOM
 srandom((unsigned int) time(0) * getpid() * (php_combined_lcg() * 1.0));
#else
 srand((unsigned int) time(0) * getpid() * (php_combined_lcg() * 1.0));


cd ../../
Here are the options I used to configure PHP. My MySQl is in the home
directory.
./configure \
--with-mysql=/home/mysql \
--with-apache=../apache_1.3.19/ \
--enable-track-vars
make
make install

[10] Configure Apache. The easy way to do this is to replace your
config.status
file with this:

cd ..
cd apache_1.3.19/
vi config.status

#!/bin/sh
##
##  config.status -- APACI auto-generated configuration restore script
##
##  Use this shell script to re-run the APACI configure script for
##  restoring your configuration. Additional parameters can be supplied.
##

./configure \
"--with-layout=Apache" \
"--prefix=/etc/httpd" \
"--enable-module=rewrite" \
"--enable-module=so" \
"--enable-module=mmap_static" \
"--enable-module=log_agent" \
"--enable-module=log_referer" \
"--enable-module=mime_magic" \
"--enable-module=info" \
"--enable-module=speling" \
"--enable-module=auth_anon" \
"--enable-module=auth_dbm" \
"--enable-module=auth_db" \
"--enable-module=digest" \
"--enable-module=cern_meta" \
"--enable-module=expires" \
"--enable-module=headers" \
"--enable-module=usertrack" \
"--enable-module=example" \
"--enable-module=unique_id" \
"--activate-module=src/modules/php4/libphp4.a" \
"--activate-module=src/modules/extra/mod_auth_pam.o" \
"$@"


Now run config.status and make Apache:
./config.status
make

DO *NOT* do a make install.

[11] Install the PHP configuration file:
cd ..
cd php-4.0.4pl1
cp php.ini-dist /usr/local/lib/php.ini

[12] Edit the PHP configuration file:
vi /usr/local/lib/php.ini

[13] Edit your srm.conf:
vi /etc/httpd/conf/srm.conf
    
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php

[14] Backup the old Apache daemon:
cp /usr/sbin/httpd /usr/sbin/httpd.old

[15] Stop the http daemon:
/etc/rc.d/init.d/httpd.init stop

[16] Install the new http daemon:
cd ..
cd apache_1.3.19/
cp src/httpd /usr/sbin/httpd

[17] Restart the http daemon:
/etc/rc.d/init.d/httpd.init start