sudo apt-get install php5Next to make it work with apache2
sudo apt-get install libapache2-mod-php5And now restart the apache2 webserver with
sudo /etc/init.d/apache2 restartNow 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/defaultand 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.phpnow insert the following line into the new file
now with your browser go to<?php phpinfo(); ?>
yourserver/test.phpif 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
No comments:
Post a Comment