Main Content

Quick Summary - PHP installation

Archive - Originally posted on "The Horse's Mouth" - 2008-12-12 00:27:07 - Graham Ellis

For Course Delegates - a quick reminder of the crucial commands. The numbers alongside the commands are just the history numbers!

As your regular user:

1012 tar xzf bristol/php-5.2.5.tar.gz
1013 cd php-5.2.5/
1015 vi INSTALL
1027 ./configure --with-apxs2=/usr/local/httpd_2.2.10/bin/apxs --with-mysql=/usr/local/mysql
1028 make
1030 make test

Then as root:

1001 cd /home/trainee/php-5.2.5
1002 make install
1004 cp php.ini-dist /usr/local/lib/php.ini
1006 cd /usr/local/httpd_2.2.10/conf/
1007 vi httpd.conf
1008 cd ..
1009 ./bin/apachectl stop
1010 ./bin/apachectl start

In that vi ... add to end of httpd.conf:

AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

To test ... add something like
  It is the year <?php print(date("Y")) ; ?> !!
to an existing web page, change it to a .php, and check that it runs

Notes

a) Apache httpd needs to be built first and with --enable-so option (big catch this one if you have installed Apache hhtpd and simply followed the Apache httpd instructions!)

b) MySQL needs to be unpacked too, to provide header files

c) Directory names and release numbers are the ones I was using yesterday - they'll vary for your own systems of course!