Developing web application with PHP-MySql-Apache in Ubuntu Linux

I have started using Ubuntu 8.04 in few days ago and found it Great. So, now I’ve moved my development environment from windows and working in Ubuntu. Here I am just explaining what steps I had to take for this jump. Also have a listing of some development related softwares/tools which I am using as replacement of windows applications.

Installing Apache, Php5, MySql in Ubuntu:

You can install Apache, Php, Mysql and other applications from Synaptic Package Manager. Go to System > Administration > Synaptic Package Manager and search with your desired application name. When found, double-click on package name. The package will be marked for installation along with it’s dependences. Now click on apply button to install the package. In this post, the red+bold texts are the name of software package which can be installed from Synaptic Package Manager.

To make your system ready for PHP development, you have to install more or less this packages: apache2.2-common, apache2-utils, php5, mysql-server-5.0, mysql-client-5.0, mysql-query-browser etc. You may also require some common php extensions which may not installed automatically with PHP installation. Most of them also will be found in Synaptic Package Manager as php5-gd, php5-curl, php5-mysql, php-pear etc.

Paths of important directories

One of the major differences I find here is the file system. All the directory paths I’ve been using in windows are changed here. I m listing here some PHP-MySql related paths here. But they may differ on your installation.

  • Apache configation files: /etc/apache2/
  • localhost root directory: /var/www/
  • PHP ini file: /etc/php5/apache2/
  • PHP extensions configuration files : /etc/php5/conf.d
  • MySql Data files: /var/lib/mysql/mysql
  • MySql Configuration files: /etc/mysql/

PHP Editors for Ubuntu

Gedit is the default text editor of Ubuntu and it support syntax coloring for many languages including PHP. But If you want an advanced editor for programming, you can try Geany or Screem. But, I am sure, who’ve been using advanced IDEs like PHPEd or PHPDesigner in windows, none of this can satisfy him. Don’t worry, the great open source IDE eclips has PHP-Development-Tool. It’s surely one of the best PHP IDE.

Subversion in Ubuntu

Subversion maintains current and historical versions of source code and documentation. It’s very important for distributed application development. RapidSVN is a graphical client for the subversion revision control system (svn) for linux. If you want to use svn from command line, install subversion.

File Difference and Merging Tools for Ubuntu

I have been using WinMerge in windows as file comparison and merging tool along with TortoiseSVN. Now using TkDiff as it’s alternative in linux. TkDiff has advanced functionalities and graphical interface. It provides file-merge and change-summary facilities, line number toggling (for easier cut & paste) and support for Subversion, RCS, CVS and SCCS. To use from command line, diff is may be the simplest file comparison tool.

Ftp and SSH

Ubuntu installs its default programs for FTP, SSH and many other internet applications. But, I’ve liked gFTP as FTP application because of it’s interface is similar to SmartFTP. And for working with SSH, required nothing. Just open the terminal and use ssh command. Write something like ssh and press ENTER.

Testing in IE

One of the important (and painful to me) issue of web development is testing the output in IE. Though IE has no version for Linux, you can install it through wine. Wine is a application that crates a virtual environment for installing windows applications in Linux. After installing wine, you can install any available version of IE from

When witting this post, my aim was to help a developer who is thinking to switch to Ubuntu Linux or a newcomer here. You are welcome to add your valuable comment/suggestion for the same purpose.


  1. I used XAMPP on my Ubuntu for web development.
    To quote their site:
    “XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use – just download, extract and start.”
    It is really as simple as that.

  2. Nice post. It would have been better if you had some links on the installation of the tools you mentioned.

  3. Yes its easily to install, but then you don’t get to learn the things. I always believe in setting it up manually so that you learn the things as you progress.

  4. sudo apt-get install apache2
    sudo apt-get install php5 php5-cli
    sudo apt-get install pear
    sudo apt-get install mysql-common mysql-client-5.0 mysql-server-5.0

    and you are set for building the history 😀

  5. Thanks, very helpful.

    I recently converted to Ubuntu after my vista OS become unusably slow – and I love it! Ubuntu is amazing! Now I am moving my dev skills set to linux.

    I highly recommend all to test drive ubuntu.

  6. I an very new to Kubuntu and have been a Windows guy FROEVER and would love to learn how to make the switch.

    Any help would be appreciated

  7. A nice introduction. I also use Ubuntu for developing web applications, but I have chosen another way for installing. For Apache, MySQL and PHP I installed XAMPP ( which is also available for linux. After unzipping it you can use it out of the box.

    As FTP Client I use Filezilla ( I also used this one on windows.

    For testing web applications in IE I use VirtualBox (also for free) with a Windows XP in). I determine that webpages don’t equal on different operating systems and the same browser (because of the fonts).

  8. Thanks. Its a nice introduction. I’ve installed everything required but cant create a folder in my “/var/www/”
    what can be wrong.

  9. I meet a mistake like you. I have fixed it.
    You can go to System –> Administration –>synaptic Package Manager.
    After that you find key word: phpmyadmin. and install that. It required you input the password. Type the password you want.
    The end, you type: http://localhost/phpmyadmin.
    input user: root
    password: Pass that you have input above.

Leave a Comment

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