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

[cobalt-developers] PHP4: how to install it on RaQ3



Hi there,
I've just managed to compile and install PHP4 (and the latest stable version of MySQL)on RaQ3.
I've chosen to not replace the standard Apache webserver already installed on my server, because I don't want the hassle with directory structure and other dependencies on my RaQ.

The trouble with Apache modules like PHP is that you have to build it inside the Apache source tree. But thanks God there are DSO and APXS (APache eXtenSion). With these two you don't have to re-build Apache to integrate a new module into Apache. To have more understanding about DSO and APXS please read the Apache documentation about DSO.

If you are in hurry and want PHP4 asap, below is an excerpt from Apache documentation about DSO:
"To simplify this creation of DSO files for Apache modules (especially for third-party modules) a new support program named apxs (APache eXtenSion) is available. It can be used to build DSO based modules outside of the Apache source tree. The idea is simple: When installing Apache the configure's make install procedure installs the Apache C header files and puts the platform-dependent compiler and linker flags for building DSO files into the apxs program. This way the user can use apxs to compile his Apache module sources without the Apache distribution source tree and without having to fiddle with the platform-dependent compiler and linker flags for DSO support."

BTW: you have to install MySQL first before you begin with PHP. Just follow the instruction in the manual and it will up and running smoothly.

And these are the steps you have to take to install PHP4 on your RaQ3:

-open file /usr/sbin/apxs with an editor, e.g. vi
	$>vi /usr/sbin/apxs
 edit the line with $CFG_LIBEXECDIR to:
	my $CFG_LIBEXECDIR    = '/usr/lib/apache';

 NOTE: change /usr/sbin and /usr/lib/apache to the appropriate directories
       on your machine.
       /usr/sbin is the directory where you can find apxs
       /usr/lib/apache is the directory where Apache keept it's shared library,
       usually the directory where you can find libperl.so

-unzip your php package in a directory of your choice
	gunzip php_xxx.tar.gz

-then untar it like this:
	tar xvf php_xxx.tar

-go to directory php_xxx
	cd php_xxx

-start the configuration of your php source
	$yourdirectory/php_xxx>./configure \
					--with-apxs=/usr/sbin/apxs \
					--with-mysql \
					--enable-track-vars
 NOTE: change /usr/sbin to the appropriate directory on your machine

-now we can build php
	$yourdirectory/php_xxx>make

-copy the files to the right directory
	$yourdirectory/php_xxx>make install

-copy the php.ini-dist to the right directory
	$yourdirectory/php_xxx>cp ./php.ini-dist /usr/local/lib/php.ini
 NOTE: you may need to edit your php.ini to your needs
       check your php documentation for this, but normally you can let it as it is

-open your httpd.conf with an editor, usually you can find it in
 /etc/httpd/conf
	$>vi /etc/httpd/conf/httpd.conf
 check whether these lines has been added to httpd.conf:

 LoadModule php4_module        /usr/lib/apache/libphp4.so
 AddModule mod_php4.c

 if you can not find it in any lines add them manually

-stop and start your Apache (not just restart it!)

-Voila! You are ready to use PHP4 on your RaQ3




--
Iwan D. Binawan
Technical Operation Manager
Adera Nederland
Stadhouderskade 6 1054 ES Amsterdam The Netherlands
Phone: +31 20 6071202 Fax  : +31 20 4121492