Tag Archives: php

Apache on Ubuntu

how to install LAMP – Apache, MySQL & PHP on Ubuntu 11.10

Ubuntu has become popular not only among desktop users but also among the web developers who uses Linux distribution to deploy their web application (on a VPS or dedicated host), although they preferred to use LTS (Long Term Support – typically of five years for Server Edition) version rather than a regular stable release because of obvious advantages – increased stability (Although, from the next release i.e Ubuntu 12.04 LTS, Desktop version will also get 5 years of support).

Despite of that fact, a lot of users/developers also use Apache server on their localhost for testing/development (e.g wordpress developers use it) and this post is written for those who want to get started with Apache, PHP, MySQL, phpMyAdmin etc with Ubuntu 11.10. Apache is the most popular web server on this planet (total share is above 65%). It is an open source and cross-platform web server. Apache supports a lot of server side language and the features is extensible using modules. PHP dominates the web scripting world and MySQL is the most popular open source database. Most of the websites (including the blog – you’re reading right now) are based on the great combination of Linux, Apache, MySQL and PHP (Commonly called as LAMP).

Setup LAMP in Ubuntu 11.10

step 1. Installing Apache

Apache on UbuntuOpen terminal (press Ctrl+Alt+t) and execute the command –

sudo apt-get install apache2

The above command will install some default modules, packages and libraries but you later install the ones you need. When installation is completed, type the address http://localhost in the browser address bar and you will get a default apache page like this –



MySQLstep 2. Installing MySQL

Execute the command –

sudo apt-get install mysql-server

and enter the root password during installation procedure. I’ve already covered a post in detail about how to install MySQL on Ubuntu 11.10.

step 3. Installing PHP

Execute the command –

sudo apt-get install php5 libapache2-mod-php5 php5-mysql

Then restart the Apache server to load php modules –

sudo /etc/init.d/apache2 restart

To test whether the PHP 5 has been successfully installed or not, create a file phpinfo.php and copy the following content (to the file) –

print_r (phpinfo());

and put the file in root web directory (/var/www). Then open the address http://localhost/phpinfo.php, then it should display the php configuration details like this –

testing php on Ubuntu

That’s All.. Linux (Ubuntu is itself a Linux based OS), Apache, MySQL and PHP i.e all the components of LAMP has been installed successfully.

To manage MySQL database from a GUI, You may like to install phpMyAdmin – The MySQL web administration tool, a great application for managing – creating and maintaining MySQL database.

How to install phpMyAdmin on Ubuntu 11.10 ?

just execute the command –

sudo apt-get install phpmyadmin

When the installation is complete, move on to http://localhost/phpmyadmin and login (using the MySQL login username(default is ‘root’) and the password (you entered during installation)) to start using it.

Want to learn web server administration (with LAMP) on Ubuntu Server ?

Having apache, MySQL, PHP installed locally on your system is good for learning about the server administration and other cool/great stuffs related to Linux but VPS is very cheap these days so you may want to try Ubuntu (with Apache or other web server) on a VPS for much better (and real) experience – I’ve been using Linode VPS @ $19.95/month (512 MB RAM, 20 GB space and 200GB bandwidth) for a while, and I am loving it.

PHP 5.3.8 released

PHP 5.3.8 Released! Download it Now!!

Few minutes before, PHP development team has announced (Official Website of PHP) the new version of PHP i.e PHP 5.3.8 released today! The new version i.e 5.3.8 fixes some major bugs such as related to crypt() (which returns only the salts for MD5) of its predecessor version 5.3.7 (released on Aug 18,2011).

PHP (Personal Home Page or Hypertext Preprocessor) is one of the most popular scripting language, originally developed for creating dynamic web pages. It is available as free software, released under PHP license (very similar to GPL). PHP runs on all platform. Most of the web pages uses PHP. The web page you are reading right now uses wordpress CMS, which uses PHP for server side programming.

Download PHP 5.3.8 from its official website.

PHP 5.3.8 released

Why PHP is so popular ?

  • PHP is an dynamic and object oriented scripting language
  • it’s powerful – Facebook, WikiHow, WordPress Powered – Millions of Blogs uses PHP
  • it’s very simple to start/learn, learning curve is not so steep like Java or C/C++
  • it’s a productive language like Ruby
  • it’s very popular and lot of references and tutorials are available freely on the World Wide Web
  • server side programming is Fun with PHP

References : 

How to install PHP in Ubuntu 10.04

install php on ubuntu 10.04 lucid lynx

PHP(Hypertext Preprocessor) is a server side script language and it is very useful in making dynamic websites by connecting through database(e.g MySQL).It is open source and free.You can install it on Ubuntu 10.04 or any other distribution of linux in many ways e.g by using Synaptic Package Manager or Install it manually after downloading it from it’s website.PHP comes in many packages and modules,so it depends on your work.In general there is a software called LAMP(For Linux),contains all the combination required for web designing.L stands for Linux,A for Apache,M for MySQL and P for PHP.If you have installed other softwares,then correct php modules you can install it by the following method.

Install PHP on Ubuntu 10.04 Lucid Lynx

Using Command Line/Terminal

Just Type the following command at ubuntu terminal(Hit CTRL+ALT+T to open terminal) and enter the login password.

$ sudo apt-get install php5 libapache2-mod-php5

Using Synaptic Package Manager

1.Go to Synaptic Package Manager and search for php.
2.Check the boxes corresponding to the package/module you want to install.
3.Click on Apply to begin the download.It will take few minutes to complete.
4.After completion of download,installation will begin automatically and hardly takes a minutes.(You may have to provide extra details e.g if you want to connect it through MySQL database).
5.That’s All.