Forum Moderators: bakedjake
sudo apt-get install apache2
And I tried using this to install PHP:
sudo apt-get install php4
sudo /etc/init.d/apache2 restart
sudo gedit /var/www/testphp.php
but it didn't work. Besides, I would like to install PHP 5.x.x if possible. Any ideas or tutorials maybe?
You can get nice up to date PHP5 packages which work well in Ubuntu Hoary by adding the following lines to your /etc/apt/sources.listdeb [people.debian.org...] php5.0 hoary
deb-src [people.debian.org...] php5.0 hoaryJust run apt-get update and then they will appear in apt.
Then you should be able to:
sudo apt-get install php5
sudo /etc/init.d/apache2 restart
sudo gedit /var/www/testphp.php
You'll need to verify that /var/www is where your server is looking for requests. In my Apache install it was /var/www/localhost/htdocs by default, which I changed in my httpd.conf (Apache configuration file).
You're probably gonna need mod_php too:
sudo apt-get install libapache2-mod-php4(or 5)