<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My Small Corner Of The Web &#187; PHP</title>
	<atom:link href="http://www.mysmallcorneroftheweb.co.uk/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.mysmallcorneroftheweb.co.uk</link>
	<description>Android development, Programming, and Ubuntu How To&#039;s</description>
	<lastBuildDate>Sun, 18 Dec 2011 16:43:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to install Apache, MySQL, and PHP (LAMP) on Ubuntu</title>
		<link>http://www.mysmallcorneroftheweb.co.uk/ubuntu/ubuntu-how-to/how-to-install-apache-mysql-and-php-lamp-on-ubuntu</link>
		<comments>http://www.mysmallcorneroftheweb.co.uk/ubuntu/ubuntu-how-to/how-to-install-apache-mysql-and-php-lamp-on-ubuntu#comments</comments>
		<pubDate>Tue, 31 Mar 2009 21:18:56 +0000</pubDate>
		<dc:creator>Jonny</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Ubuntu - How to]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[LAMP]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[navicat]]></category>
		<category><![CDATA[package]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[WAMP]]></category>

		<guid isPermaLink="false">http://www.mysmallcorneroftheweb.co.uk/?p=133</guid>
		<description><![CDATA[This is a HOW TO guide to installing LAMP (Linux Apache MySQL PHP). This consists of Apache web server, MySQL database (as well as a DB tool), and PHP. Together these can be used to run as a local web server on your computer, using Ubuntu distribution of Linux. This is similar to WAMP, which [...]]]></description>
			<content:encoded><![CDATA[<p>This is a HOW TO guide to installing LAMP (Linux Apache MySQL PHP). This consists of Apache web server, MySQL database (as well as a DB tool), and PHP. Together these can be used to run as a local web server on your computer, using Ubuntu distribution of Linux. This is similar to WAMP, which is the Windows version.</p>
<p>The idea of this HOW TO is to explain how to get these working together, with little to no use of the Terminal Command Line, but I will give the command line interface (from now on I will call this CLI) as well as they do make life a little faster. For this we will be using the &#8220;Synaptic Package Manager&#8221; (from now on I will call this SPM) which can be found on Ubuntu in System -> Administration -> Synaptic Package Manager.</p>
<p>So first up we need to install the Apache Web Server. Type the following into the SPM Quick Search box:</p>
<p><code>apache2</code> </p>
<p>If you add a space after it will be the first result returned, without and it will be the third. For all SPM options make sure you mark them for  The command line alternative is (it assumes that you are running as a sudo user, this is the same for all CLI alternatives written here):</p>
<p><code>sudo apt-get install apache2</code></p>
<p>To check if this works, click <a href="http://localhost">http://localhost</a>, which points to your new local web server. If the words &#8220;It works!&#8221; appear then everything is on track!</p>
<p>With Apache installed, we now want to install PHP. For this use either SPM and search for:</p>
<p><code>php5</code> and <code>libapache2-mod-php5</code></p>
<p>Or using the CLI: <code>sudo apt-get install php 5 libapache2-mod-php5</code></p>
<p>Next we need to restart the Apache server so it loads PHP. To do this without the CLI you need to use &#8220;Run Application&#8230;&#8221;, this can be found by right clicking one of the task-bars and and adding the &#8220;Run Application..&#8221; to the task bar panel. Once this is done type the following command:</p>
<p><code>gksudo /etc/init.d/apache2 restart</code> Note: This will prompt for your password</p>
<p>Or using the CLI: <code>sudo /etc/init.d/apache2 restart</code></p>
<p>Now you need to check that PHP is installed correctly. We need to create a small PHP file in the Web Servers directory that displays the PHP info. To do this we are going to run the following command under &#8220;Run Application&#8230;&#8221;:</p>
<p><code>gksudo gedit /var/www/testphp.php</code></p>
<p>Or using the CLI: <code>sudo gedit /var/www/testphp.php</code></p>
<p>Once GEdit is open add the following line and save the file: <code>phpinfo();</code> inside opening and closing PHP tags</p>
<p>Now check that this has worked by clicking : <a href="http://localhost/testphp.php">http://localhost/testphp.php</a></p>
<p>This should display all the information about the PHP configuration that&#8217;s just been installed. Now we move on to the last part which is to install the MySQL server. Using the SPM find and install:</p>
<p><code>mysql-server</code></p>
<p>Or using the CLI: <code>sudo apt-get install mysql-server</code></p>
<p>This will run the MySQL set-up which will at some point prompt you for a root password. This is for root login to your MySQL server, and you&#8217;ll need to enter it twice.</p>
<p>After MySQL has been set-up there are two more packages that you need, the first is MySQL libraries for PHP 5, and the second is for Apache to use MySQL.</p>
<p><code>php5-mysql</code> and <code>libapache2-mod-auth-mysql</code></p>
<p>Or using the CLI: <code>sudo apt-get install libapache2-mod-auth-mysql php5-mysql</code></p>
<p>Once these have been installed you need to tell PHP about the MySQL extension by editing the php configuration file. This can be done using &#8220;Run Application..&#8221; using:</p>
<p><code>gksudo gedit /etc/php5/apache2/php.ini</code></p>
<p>In this file you need to find the line that says <code>;   extension=msql.so</code>, remove the ; from the begining of the line, save and close the file.</p>
<p>That&#8217;s it, Apache, PHP &#038; MySQL are all installed and set-up. However there is one more stage that might be of use. That is to install Navicat, which allows easy administration to a MySQL Database. First head to the <a href="http://www.navicat.com/download.html">Navicat Download Page</a> and get the appropriate version. I use the Lite (non-commercial) version.</p>
<p>Once your downloaded the tar ball, extract it to where ever you want Navicat to be installed. To run it create a shortcut to the <code>start_navicat</code> file.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mysmallcorneroftheweb.co.uk/ubuntu/ubuntu-how-to/how-to-install-apache-mysql-and-php-lamp-on-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

