How to Install PHP5 in Puppy LINUX

Introduction

This is the 2nd part of the series that shows how to install the LAMP stack within Puppy LINUX. The 1st part dealt with how to install Apache.

Installing Apache was quite a challenge but PHP was actually very easy. Follow the instructions below and you will have a working version of PHP within an Apache environment.

Setup

The environment I am using is a USB drive running Lucid Puppy 5.2.8 which can be downloaded from http://puppylinux.org/main/Download%20Latest%20Release.htm.

To install Apache follow the instructions from http://everydaylinuxuser.blogspot.co.uk/2012/08/how-to-install-apache-in-puppy-linux.html.

Instructions

1. Click the install icon which can be found on the top row of icons.
2. Enter PHP into the Find box (highlighted in the image above) and click Go,
3. From the list of options click the top option which is PHP5_5_3_2.

NB: If you do not have a list of files like the ones above you need to turn on the UBUNTU Lucid repositories by clicking the “Configure Package Manager” button and selecting the 3 UBUNTU repositories. You will need to restart by exiting the application and repeat the instructions from step 1 to step 3.

4. A window will appear asking whether you want to just install the package selected or examine for all dependencies. Click the examine for all dependencies option.
5.When the installs have finished PHP is effectively installed. To test it go to /var/www/htdocs and create a file called index.php.
6. In the index.php page enter <?php PHPINFO(); ?> and save the file.
7. Open up the browser and type http://localhost/index.php

8. At this point you will notice that your page does not show up but you are offered the option of saving the file or opening it with another application. This is of course not what we want to happen.
9. Open a console window (Top line of icons) and run the command

 grep “.php” /etc/apache2/mods-available/php5.conf

10. Now run the following command:

a2enmod php5

11. Finally restart Apache by running the command:

 /etc/init.d/apache2 restart

12. Now within your browser enter http://localhost/index.php

There you have it PHP5 working.

It is worth noting at this point that some key libraries have not been installed such as the GD library for graphics and the CURL library.

If you click install and type PHP in the find box you will see a list of other PHP libraries available. You can either install them now or wait until you need to use one of them.

Summary

Installing PHP was fairly easy. This guide and the one for Apache was for use as a portable web server which enables development on the move.

I hope you found this useful.

The next part of the series will show you how to install MySQL in Puppy LINUX.

Thanks for reading.

Click here to buy Puppy on DVD or USB

5 Comments

  1. If you had troubles installing apache2 and solved those by deleting the logs (as anonymous has commented), you should not insert this line:
    grep ".php" /etc/apache2/mods-available/php5.conf

    It will create a conflict with the port numbers, and you might not be able to find a solution online.

    Cheers!

Leave a Reply