Install php manually with tar file (Ubuntu)
Posted on by Fuad Abdul Zabar
Install php manually
1. Download the latest source code from PHP Download page. Current stable release is php-5.5.9.tar.bz2. Move the source to /usr/local/src and extract is as shown below.
bzip2 -d php-5.5.9.tar.bz2
tar xvf php-5.5.9.tar
cd php- php-5.5.9
2. Again, this step is semi optional as it deals with configuring php before you install it. So, if you want to customize the installation, or see how you can customize it:
3. The next commands actually install PHP, with the default apache install location of /usr/local/apache2:
cp php.ini-dist /usr/local/lib/php.ini
4. Open the file /usr/local/apache2/conf/httpd.conf and add the following text:
Then while in that file make sure it has a line that says LoadModule php5_module modules/libphp5.so
5. Now you will want to restart apache and verify that php is installed and woking correctly:
No make a file called test.php in your /usr/local/apache2/htdocs folder with the following line in it:
<?php phpinfo(); ?>
Now point your favorite internet browser at http://local-host/test.php and it should tell you all about your working php installation.