Cannot run phpinfo() on Ubuntu 8.04LTS

Asked by uye

i have installed apache2 php5 libapache2-mod-php5 on my Ubuntu 8.04 LTS box without raising any errors. When i browse to index.html found in /var/www directory by surging to http://myBoxName from FireFox browser, it does display the page. i create a test.php page in /var/www as follows.
# test.php
<?php phpinfo(); ?>
When i point my FireFox browser to http://myBoxName/test.php, it only prompts me to save the file without displaying phpinfo.
Pls help me to use php with my apache2. Thanks in anticipation.

Question information

English Edit question
Ubuntu php5 Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
David Hoeffer (d-hoeffer) said :

You'll have to enable mod_php. Just run "sudo a2enmod php5" and then "/sudo etc/init.d/apache2 force-reload". That should do the trick.

Revision history for this message
uye (yemyint-1618) said :

Thank You David for giving me guidance. When i try sudo a2enmod php5 i have the reply that
This module is already enabled!
Then i try sudo etc/init.d/apache2 force-reload and get reply as
sudo : etc/init.d/apache2 : command not found.
I do have shell script or exec in my etc/init.d folder a file named apache2
Pls do give me more replies. Thanks.

Revision history for this message
marcobra (Marco Braida) (marcobra) said :

the command is: sudo /etc/init.d/apache2 force-reload

Revision history for this message
D2 (darryl-enslon) said :

Silly, unobvious, but this error message caught me briefly, and my system's cause was DNS misconfiguration. The system was initially installed without a net connection and once I got that allocated, I neglected to go back and edit my resolv.conf file. You should see something like this in /etc/resolv.conf:


The search line usually only shows up in enterprises where DNS servers are locally maintained. It gives names that'll be appended to short names (in my example, requests for 'myserver' generate DNS requests for and

The nameserver lines need your DNS servers. Get these values from your ISP or DNS administrator can help you tweak the nameserver fields.

Can you help with this problem?

Provide an answer of your own, or ask uye for more information if necessary.

To post a message you must log in.