Install PHP 5.3 Mysql 5.5 Apache on Debian

→ Are you a new visitor? Please visit the page guidance for new visitors ←

Install PHP 5.3 Mysql 5.5 Apache on Debian

The other day I had a friend who just ordered a new bare VPS server and wanted to install phpmyadmin on it and run some php scripts and storing into a mysql database. He was running an OpenVZ Debian installation and I thought this just now that it would be a nice tutorial for other users trying to install PHP 5.3 Mysql 5.5 Apache on Debian. So here it is, I’ll go with a step by step with what you would need to use to install to get everything installed.

Installing Apache web server

On Debian it’s easy to install Apache directly from repository, you can manually compile it also if its really required but I really didn’t need to do it myself till now. So to install Apache run the below commands:

By default you should have the repository for installing this. Once the web server is installed, you should be able to browse your server IP address and you should see it working.

Installing the Mysql server

In my next step it would the Mysql server 5.5, by default this should also be present on squeeze or wheeze, so you can just run the command:

This would install the mysql server and it will ask you for the root password. Enter it twice please and you should be finished.

Installing php and php extensions on Debian / Ubuntu

This part contains more packages that need installed, for instance you need to install the mysql extension for the mysql server and also the mod_php5 module for apache web server. Of course other php extensions would need installed too.

However you will need to use a new repository / source list to install php 5.3, on debian I would recommend using Dotdeb.  So you edit your source lists ( /etc/apt/sources.list ) and add there the line:

  • for debian wheezy

  • for debian squeeze

You will also need to fetch and install the GnuPG key:

After this you can run the update command to update the apt package list:

Next you can start the php installation and get everything up and ready.

  • Apache module mod_php5 installation

  •  Install other php extensions including php5-mysql

By now you should have a bunch of packages to be installed, this should get you with almost everything installed and you should be good to go.

Last step is to restart your web server for all extensions to load:

View phpinfo() page

To confirm everything is complete and working, you can create the a file info.php and add the content:

You would then see a similar page when loading your serverIP/info.php

install php 5.3 mysql and apache

Install php 5.3 mysql 5.5 apache

And that would be all folks, easy and simple, a web server running apache with  php 5.3, mysql 5.5 would be up and running.

If you find any errors or anything you want to add, please let me know and comment below.

Request an article ←