Php

Install PHP to an Apache web server in Ubuntu Linux



In this tutorial, I download and install PHP to an Apache web server using Ubuntu 11.10 Linux. After installing I run a quick test to make sure PHP is working correctly.

Go here for Part 3 Installing MySQL and PhpMyAdmin:

Go here for Part 1: Installing Apache web server:

Please subscribe and visit my website at

Similar Posts

39 thoughts on “Install PHP to an Apache web server in Ubuntu Linux
  1. sudo apt-get install php5 libapache2-mod-php5
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package php5 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Package libapache2-mod-php5 is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    E: Package 'php5' has no installation candidate
    E: Package 'libapache2-mod-php5' has no installation candidate
    DOSE NOT WORK

  2. yup here is the l33t style haxer fix lmao
    YOU SHOULD PIN THIS COMMENT!

    instead of
    sudo apt-get install php5 libapache2-mod-php5 -y
    do
    sudo apt-get install php libapache2-mod-php -y

  3. Who can help me with this:
    I installed Apache web server and php when I tested my php file it shows me a portion of what I expected, this is the code:

    <!DOCTYPE html>

    <html>

    <body>

    <h1>My first PHP page</h1>

    <?php

    echo "Hello World!";
    ?>

    </body>

    </html>

    it shows me on localhost/test01.php

    only : "My first PHP page"

    Any suggestion?

  4. Hello thanks for the video. Suppose I want to install Apache 2.2 and PHP 5.6.x (or 7.0.2) and MySQL 5.6 or more. Do I need to change something in the install commands in order to specify the versions ? Thanks for your answer.

  5. Oh my god! I'm… so… freaking out right now! I couldn't get apache to start on my old windows os because I needed special permission from the administrator, now that I'm on linux, I can run apache and get php to start… I'm so happy that I'm freaking out!

  6. Great tutorial but like another poster, my test.php won't open in my browser. I get a no file found error. I checked the obvious stuff like path and file name and php script. I altered the HTML test script and it responded when I went to Local Host.
    The only thing I can think of is that I did not have apache server running when I did the install. I started it afterwards, after the PHP installation. The file is there and exactly as indicated in this tutorial. Any suggestions ?

Leave a Reply

Your email address will not be published. Required fields are marked *