Single line command to install PHP5, MySQL, Apache2, XCache, PHP-Pear on Raspberry Pi

Installing LAMP on Raspberry Pi is very very simple. It takes a single line to execute on terminal / console.

sudo apt-get update; sudo apt-get -y install mysql-server php5-mysql apache2 apache2-utils php5 libapache2-mod-php5 php-pear php5-xcache php5-curl php5-gd

Copy-paste the above line in terminal and press Enter. You will be asked to choose MySQL Server password. Choose wisely. Wait for it to complete and you are done. Now you can install any PHP / MySQL based programs and run it on the installed Apache server.

Notes;

  • sudo is used to run this command in Super User mode
  • apt-get update is important because it updates your Pi installation to latest version. Without it the following installation may fail (speaking from experience).
  • apt-get install is what installs the required software
  • -y answers yes for you when apt-get asks your permission to install

The following instruction was tested on Raspbian Jessie build, which at the time of writing is the latest build.

Questions:

  • Why should you use Raspbian distro for Raspberry Pi?
    It is maintained by the developers of Pi and as such most optimized for Pi hardware and most aggressively maintained
  • Why should you use Jessie and not earlier builds?
    Latest versions supports newer peripherals and comes with all the latest bug fixes and optimizations.
  • How to test Apache HTTP server is properly installed on Raspberry Pi?
    You can check the default web page at http://localhost/ if you are accessing from Pi or http://ip-address-of-pi/ from any other machine.

Author: Angsuman Chakraborty

Software architect and entrepreneur with substantial experience in designing and developing enterprise software and services for Fortune 500 companies as well as startups. Enjoys solving complex software and bioinformatics problems. Currently heading a product development & outsourcing company specializing in Web 2.0 technologies. Products: Relaso Mobile CRM =============== Website: http://www.relaso.com/sales-crm/ Google Play: https://play.google.com/store/apps/details... Demo Video: https://www.youtube.com/watch?v=XROR0OCLI2c (draft) Relaso One ========= Website: http://www.relaso.com/one/ Google Play: https://play.google.com/store/apps/details?id=com.relaso.one Intro Video: https://www.youtube.com/watch?v=34jF5CVSB6o Walk-through Video: https://www.youtube.com/watch?v=qE_M1Kks7O4 Relaso Social CRM =============== Intro Video: https://www.youtube.com/watch?v=zevsXywpd8w Walk-through Video: https://www.youtube.com/watch?v=fBElL4ow1hU Specialties: Software Architecture, Software Design, Software Consultant, Java Developer, Web 2.0, Custom product development, Bioinformatics, Software Outsourcing, Management Consultant

Leave a Reply

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