-1

I just ran sudo apt-get install lamp-server^ on my Ubuntu 11.04 Desktop computer to get my localhost server up and running. Now when I type in localhost to my web browser it only shows .html files that are in the var/www/ folder and not php. When I try to view a php file, it only "downloads" the file.

Any idea what's happening here?

000-default file:

ServerAdmin webmaster@localhost

DocumentRoot /var/www
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
    Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

codedude
  • 107
  • 1
  • 5

2 Answers2

1

Do you see php5.conf and php5.load under /etc/apache2/mods-enabled/? If not then enable it with sudo a2enmod php5. If yes then sudo /etc/init.d/apache2 restart.

For any other suggestion we need more information. For example the file /etc/apache2/sites-enabled/000-default

mailq
  • 16,882
  • 2
  • 36
  • 66
0

It sounds like the PHP module isn't loaded by apache or apache has not been notified of the handler. Scan through your apache configs and see if there is a LoadModule for php and an AddHandler.

On my system (sorry, it's CentOS, I don't have Ubuntu available), it looks like this:

LoadModule php5_module modules/libphp5.so 
AddHandler php5-script .php
AddType text/html .php

These are present in a seprate config file (/etc/httpd/conf.d/php.conf) provided by the PHP package. I assume Ubuntu handles this more or less the same.

Sgaduuw
  • 1,823
  • 12
  • 16