Friday, November 17, 2006

Installing php5

It has been a while since my last post. In this post I want to talk about installing php5. I start with
sudo apt-get install php5
Next to make it work with apache2
sudo apt-get install libapache2-mod-php5
And now restart the apache2 webserver with
sudo /etc/init.d/apache2 restart
Now test if it all works. the DocumentRoot is standard set to the directory "/var/www" So all php files you produce must be placed into this directory. To change the DocumentRoot location type
sudo vi /etc/apache2/sites-available/default
and change the DocumentRoot on line 5 in something else.I decided to keep the DocumentRoot to /var/www. Now go to this directory and make a test.php file with
sudo touch test.php

edit the file with
sudo vi test.php
now insert the following line into the new file
<?php phpinfo(); ?>
now with your browser go to
yourserver/test.php
if everything is installed correct you`ll see the php info page. Make sure so remove this file if you open your server to the public as it may pose a security risk. For more information visit ubuntu dapper wiki.

Next post about mysql and phpmyadmin

1 comment:

webhostings said...

One of the biggest benefits of this sort of web hosting service is that you can have access to the server from anywhere in the world which helps to keep your business going.web hosting companies