Cannot run phpinfo() on Ubuntu 8.04LTS

Asked by uye on 2008-11-06

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

Language:
English Edit question
Status:
Answered
For:
Ubuntu php5 Edit question
Assignee:
No assignee Edit question
Last query:
2008-11-07
Last reply:
2010-01-26
David Hoeffer (d-hoeffer) said : #1

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.

uye (yemyint-1618) said : #2

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.

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

D2 (darryl-enslon) said : #4

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:

#search mydomain.com, mydomain2.net
nameserver 192.168.111.222
nameserver 192.168.222.111

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 myserver.mydomain.com and myserver.mydomain2.net).

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.