开发者

Apache server ubuntu 10.10 returns a PHTML file to download instead of php file

I seting up LAMP on my ubuntu box. I have only changed the sites-available-default/default

 <VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /home/user/Dropbox/www/
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory /home/user/Dropbox/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOver开发者_如何学Goride 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>

</VirtualHost>

When I connect to my localhost I get a file in return. A PHTML with the index.php code.

When I connect to connect to http://192.168.1.133 I get a Forbidden error..

I assume it has something to do with permission and security, but not how to fix it.


I had the same problem, and it was because of a missing php module for apache.

$ dpkg -l | grep apache
ii  apache2                               2.2.17-1ubuntu1                            Apache HTTP Server metapackage
ii  apache2-mpm-prefork                   2.2.17-1ubuntu1                            Apache HTTP Server - traditional non-threaded model
ii  apache2-suexec                        2.2.17-1ubuntu1                            Standard suexec program for Apache 2 mod_suexec
ii  apache2-threaded-dev                  2.2.17-1ubuntu1                            Apache development headers - threaded MPM
ii  apache2-utils                         2.2.17-1ubuntu1                            utility programs for webservers
ii  apache2.2-bin                         2.2.17-1ubuntu1                            Apache HTTP Server common binary files
ii  apache2.2-common                      2.2.17-1ubuntu1                            Apache HTTP Server common files
ii  libapache2-mod-auth-mysql             4.3.9-13ubuntu1                            Apache 2 module for MySQL authentication
ii  libapache2-mod-php5                   5.3.5-1ubuntu7.2                           server-side, HTML-embedded scripting language (Apache 2 module)

I think (not sure) that libapache2-mod-php5 is the essential package to run php files with apache. So, make sure at least you have this one installed, and search a little about which packages to install to have a full php/apache installation. If you are installing xampp, download the most recent version and make sure you install it as root.


After installing all the updates to the server in linux ubuntu apache server seemed to not work tried to access the website hosted on the server and the result was a phtml file type. Then look at other pages that install packages sugieron libapache2-mod-php5 php5 (5.3.2-1ubuntu4.17)

The install using LVM Synaptic Package Manager. Then I wrote the URL of my site. this is working.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜