PHP5 files open in gedit; refuse to display properly

Asked by bary

Environments: 10.04 LTS and 10.04 LTS Server -- identical misbehavior
I create any PHP file, extension .php, and attempt to view it by double-clicking it... It either opens in gedit or Firefox asks me to download it...

This is with a freshly installed 10.04 w/wo Server... I've installed LAMP and have checked that PHP5 modules are in mods-enabled. I've tried the guidance regarding restarting apache2 and force-reload after using e2enmod...

It appears that in a fresh-installed version of Ubuntu, with LAMP support either specified or loaded later, the default is NOT to actually enable PHP within apache. STRANGE because that's exactly NOT what the documentation says. I've tried this on 4 different environments, and I've tried with 10.10 both desktop and server -- identical misbehavior.

WHAT have I failed to do? failed to check?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu php5 Edit question
Assignee:
No assignee Edit question
Solved by:
Theodotos Andreou
Solved:
Last query:
Last reply:
Revision history for this message
Best Theodotos Andreou (theodotos) said :
#1

You have to put that file under the DocumentRoot (see your apache config) and then run the file with your browser through the webserver. You can put the following URI in your browser:

  http://localhost/file.php

Revision history for this message
bary (barywp) said :
#2

Excellent! Indeed, beneath DocumentRoot the phpinfo(); function performs perfectly.
THANKS!