Difference between revisions of "Configuring a LAMPP server for PHP development/Linux desktop"

From Joomla! Documentation

< Configuring a LAMPP server for PHP development
Line 24: Line 24:
 
*The installer will ask for "mysql application password for phpmyadmin", use any password you like, but for this example we are going to use "myadmin"
 
*The installer will ask for "mysql application password for phpmyadmin", use any password you like, but for this example we are going to use "myadmin"
 
*If no errors have being displayed then the installation is finish
 
*If no errors have being displayed then the installation is finish
 +
 +
=== 1st test for Apache ===
 +
 +
*Open your web browser and type in the address bar "localhost" and press [enter]
 +
*Normally Apache display a test page with some text like this:
 +
 +
It works!
 +
This is the default web page for this server.
 +
The web server software is running but no content has been added, yet.
 +
 +
=== 1st test for PHP server ===
 +
 +
To test if PHP server is working lets create a quick test file using the command line
 +
 +
*Open a terminal and type
 +
 +
<tt>echo "<?php phpinfo(); ?>" | sudo tee /var/www/test.php </tt>
 +
 +
*Open your web browser and type in the address bar "localhost/test.php" and press [enter]
 +
*The next thing you should see in your browser is a really long page displaying information about the PHP server, if not then something went wrong
 +
*Now that we know the PHP server is working fine we don't need that test file anymore, type the following command in your terminal to delete the file
 +
 +
<tt>sudo rm /var/www/test.php</tt>
  
 
== Understanding the folder structure ==
 
== Understanding the folder structure ==

Revision as of 21:54, 4 May 2012

Quill icon.png
Page Actively Being Edited!

This article is actively undergoing a major edit for a short while.
As a courtesy, please do not edit this page while this message is displayed. The user who added this notice will be listed in the page history. This message is intended to help reduce edit conflicts; please remove it between editing sessions to allow others to edit the page. If this page has not been edited for several hours, please remove this template, or replace it with {{underconstruction}} or {{incomplete}}.

Introduction[edit]

This article provides detailed instructions for configuring a LAMPP server, not only for Joomla! it also should work fine for PHP development in general.

Theses instructions should work fine on any Debian based distribution such as Debian, Ubuntu, LinuxMint, Xubuntu, Kbuntu and others.

Installation[edit]

NOTE: You need a stable Internet connection for this tutorial

The installation of a LAMPP server on Linux is extremely easy, just follow this instructions:

  • Open a terminal and type:
sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server phpmyadmin
  • Say yes [Y] when the package manager ask you download and install the packages, this step will take some time depending on your connection speed
  • At some point the installer will ask you for the MySQL root password use any password you like, but for this example we are going to use "myadmin"
  • The installer will ask for "the web server that should be automatically configured to run phpmyadmin", choose "apache2" and press [enter]
  • The installer will ask for "Configure database for phpmyadmin with dbconfig-common", choose "<yes>" and press [enter]
  • The installer will ask for "password of the database's administrative user", use any password you like, but for this example we are going to use "myadmin"
  • The installer will ask for "mysql application password for phpmyadmin", use any password you like, but for this example we are going to use "myadmin"
  • If no errors have being displayed then the installation is finish

1st test for Apache[edit]

  • Open your web browser and type in the address bar "localhost" and press [enter]
  • Normally Apache display a test page with some text like this:
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.

1st test for PHP server[edit]

To test if PHP server is working lets create a quick test file using the command line

  • Open a terminal and type
echo "<?php phpinfo(); ?>" | sudo tee /var/www/test.php 
  • Open your web browser and type in the address bar "localhost/test.php" and press [enter]
  • The next thing you should see in your browser is a really long page displaying information about the PHP server, if not then something went wrong
  • Now that we know the PHP server is working fine we don't need that test file anymore, type the following command in your terminal to delete the file
sudo rm /var/www/test.php

Understanding the folder structure[edit]

Fine tuning[edit]