Sunday, 5 August 2012

How to Install PHP5 in Puppy LINUX

Posted by Gary Newell  |  at  23:39 5 comments


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.


The environment I am using is a USB drive running Lucid Puppy 5.2.8 which can be downloaded from

To install Apache follow the instructions from


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.


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

About the Author

Gary Newell started the Everyday Linux User blog in 2010 and has written reviews on dozens of different Linux based operating systems. He has also written a number of tutorials.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

Related posts


  1. Well, Puppy Linux is an original Linux distribution that is not based upon any other major allocation. It is lightweight, fast and portable.

  2. Great .. Frnd I am using linux but i can't install php5 then m thinking linux is a deb os but now i install that So thank u Very much help me ....

  3. 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.


  4. You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...
    iOS Training in Chennai
    Android Training in Chennai
    php Training in Chennai


Feel free to comment on any of the blog posts. Please try to be constructive.

Offensive messages will be removed as will blatant adverts for misleading products and sites.

Thanks for visiting my blog

    Popular Posts

    Total Pageviews


    Enter your email address:

    Delivered by FeedBurner

    Popular This Month

    What are other people buying?

    Ubuntu Buy
    openSUSE Buy
    Manjaro Buy
    Zorin Buy
    PCLinuxOS Buy
    gNewSense Buy
    Edubuntu Buy
    Fedora Buy
    Uberstudent Buy
    Linux Lite Buy
    Lubuntu Buy
    Xubuntu Buy


    Feedburner Followers

Blogger templates. Proudly Powered by Blogger.

back to top Google