Install Apache 2 PHP 5 and MySQL 5 on Ubuntu / Debian systems

 

  1. First install your system; either a base install of Debian or Ubuntu Server or the full desktop install, depending on what else you want to use it for.
  2. Start a terminal and type “sudo apt-get install apache2”
  3. Type “Y” when prompted to accept the new packages
  4. When it completes, open up a web browser and point it to http://localhost/ or the IP address of your box. If Apache has installed you should see a congratulatory message.
  5. In your terminal type “sudo apt-get install apache2-doc”
  6. In your terminal type “sudo apt-get install php5”
  7. Type “Y” when prompted to accept the package changes.
  8. In your terminal type “sudo apt-get install mysql-server”
  9. Type “Y” when prompted to accept the package changes.
  10. When the MySQL Server install wizard starts enter a root password for the database when prompted.
  11. Repeat when prompted
  12. In your terminal type “sudo apt-get install php5-mysql”
  13. In your terminal type “sudo touch /var/www/info.php”
  14. Now type “sudo nano /var/www/info.php”
  15. In the nano editor type “<?php phpinfo(); ?>” then press Ctrl and O followed by Ctrl and X to save and exit
  16. In your terminal type “sudo /etc/init.d/apache2 restart” to restart Apache
  17. Point your web browser to http://localhost/info.php and you should see information about your PHP set up, including a section about MySQL

One thought on “Install Apache 2 PHP 5 and MySQL 5 on Ubuntu / Debian systems

  1. Ive got a good tutorial on my site for setting up a debian/ubuntu LAMP server, with support for remote administration.

    See here:
    ttp://www.jamesben.net/?p=60

Leave a Reply to James Bennet Cancel reply

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