This page only provides steps to compile Apache and PHP. More detailed information is provided here.
Assuming Apache source and Php source are in /usr/src directory.
To compile Apache
$ cd /usr/src
$ tar -zxvf httpd-2.0.44.tar.gz
$ cd /usr/src/httpd-2.0.44
$ ./configure --prefix=/wwwroot --enable-so
$ make
$ make install
$ /wwwroot/bin/apachectl start
Now test apache installation by going to http://localhost.
Stop apache for php installation.
$ /wwwroot/bin/apachectl stop
To compile PHP
$ cd /usr/src
$ tar -zxvf php-4.3.0.tar.gz
$ cd /usr/src/php-4.3.0
$ ./configure --prefix=/wwwroot/php --with-apxs2=/wwwroot/bin/apxs --with-config-file-path=/wwwroot/php --with-mysql
$ make
$ make install
Now you have to edit Apache configuration file /wwwroot/conf/httpd.conf.
If LoadModule php4_module modules/libphp4.so line hasn't been added by php install to /wwwroot/conf/httpd.conf, then you have to add it yourself. Add it somewhere below section named "Dynamic Shared Object (DSO) Support"
LoadModule php4_module modules/libphp4.so
Now add this line to /wwwroot/conf/httpd.conf file:
AddType application/x-httpd-php .php
Start Apache now:
$ /wwwroot/bin/apachectl start
Now create a test PHP file using any text editor and add these lines to it:
<?php
phpinfo();
?>
Save it under /wwwroot/htdocs as info.php
Now test your PHP installation by accessing file info.php:
Back to Top | Web Designing and development | JSP Chat Application Code | Freelance PHP Programmer | Freelance Web Developer | Compiling PHP Article
14/11/2024 06:27