Saturday, May 26, 2007

Install Apache and PHP 5

Apache HTTP Server

from terminal type:
sudo apt-get install apache2
start Apache server:
sudo /etc/init.d/apache2 start
from web browser type into adress bar: localhost


How to install PHP 5

sudo apt-get install php5
sudo apt-get install libapache2-mod-php5
sudo /etc/init.d/apache2 restart

To test if PHP 5 installed correctly
sudo gedit /var/www/testphp.php
insert following line :

save and exit.
from web browser type to adress bar: localhost/testphp.php
If that didn't work, try these commands:
sudo a2enmod php5
sudo /etc/init.d/apache2 force-reload
(Optional) Install recommended PHP5 modules:
sudo apt-get install php5-xsl php5-gd php-pear
Restart Apache
sudo /etc/init.d/apache2 restart

The root directory of your web server is /var/www/ so you must
place your projects in this folder.


How to install MYSQL for Apache HTTP Server

sudo apt-get install mysql-server
gksudo gedit /etc/mysql/my.cnf
Find the line bind-address = 127.0.0.1 and comment it out
...
#bind-address = 127.0.0.1
...
sudo /etc/init.d/mysql restart

sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo aptitude install phpmyadmin
gksudo gedit /etc/php/apache2/php.ini
You'll need to uncomment the ";extension=mysql.so" line so that
it looks like this
...
extension=mysql.so
...
from web browser type: http://localhost/phpmyadmin
sources from http://ubuntuguide.org/wiki/Ubuntu

1 comment:

Anonymous said...

oioi, thx a lot, this was really helpful for me and so lame-friendly :)))