Pages

Monday, October 3, 2011

Install PHP 4 - Apache on Ubuntu 11.04

1. gunzip apache_xxx.tar.gz
2. tar -xvf apache_xxx.tar
3. gunzip php-xxx.tar.gz
4. tar -xvf php-xxx.tar
5. cd apache_xxx
6. ./configure --prefix=/www --enable-module=so
7. make
8. make install
9. cd ../php-xxx

apt-get install flex

apt-get install zlib1g-dev

apt-get install libjpeg8-dev

apt-get install libpq-dev

root@aslam-VGN-SZ79GN-C:~/Downloads/php-4.4.9# ./configure --with-apxs2=/opt/httpd-2.0.64/bin/apxs --with-pgsql=/usr/lib64/postgresql/8.4/bin --with-gd2 --with-jpeg-dir --with-zlib-dir --with-png-dir

12. make
(you should now have an httpd binary which you can copy to your Apache bin d
ir if
it is your first install then you need to "make install" as well)

13. cd ../php-5.x.y
14. cp php.ini-dist /usr/local/lib/php.ini

15. You can edit /usr/local/lib/php.ini file to set PHP options.
Edit your httpd.conf or srm.conf file and add:
AddType application/x-httpd-php .php

Example 2-3. Example commands for restarting Apache
1. Several Linux and SysV variants:
/etc/rc.d/init.d/httpd restart

2. Using apachectl scripts:
/path/to/apachectl stop
/path/to/apachectl start

3. httpdctl and httpsdctl (Using OpenSSL), similar to apachectl:
/path/to/httpsdctl stop
/path/to/httpsdctl start

4. Using mod_ssl, or another SSL server, you may want to manually
stop and start:
/path/to/apachectl stop
/path/to/apachectl startssl