2015-10-19 50 views
0

我遇到了Apache2服務器的問題。 我使用VDS和Debian操作系統。 服務器以純文本格式顯示所有文件。Apache將php頁面加載爲文本

這裏例如:click

Apache配置:

<VirtualHost 213.159.209.165:80> 
    ServerName pixellot.ru 
    AddDefaultCharset off 
    AssignUserID romancasper romancasper 
    DirectoryIndex index.html index.php 
    DocumentRoot /var/www/romancasper/data/www/pixellot.ru 
    ServerAdmin [email protected] 
    ServerAlias www.pixellot.ru 
    CustomLog /var/www/httpd-logs/pixellot.ru.access.log combined 
    ErrorLog /var/www/httpd-logs/pixellot.ru.error.log 
    <FilesMatch "\.ph(p[3-5]?|tml)$"> 
     SetHandler application/x-httpd-php 
    </FilesMatch> 
    <FilesMatch "\.phps$"> 
     SetHandler application/x-httpd-php-source 
    </FilesMatch> 
    php_admin_value sendmail_path "/usr/sbin/sendmail -t -i -f [email protected]" 
    php_admin_value upload_tmp_dir "/var/www/romancasper/data/mod-tmp" 
    php_admin_value session.save_path "/var/www/romancasper/data/mod-tmp" 
    php_admin_value open_basedir "/var/www/romancasper/data:." 
</VirtualHost> 
<Directory /> 
    #Options FollowSymLinks 
    Options Indexes FollowSymLinks Includes ExecCGI 
    AllowOverride All 
    Order deny,allow 
    Allow from all 
</Directory> 
<Directory /var/www/romancasper/data/www/pixellot.ru> 
    Options Indexes FollowSymLinks 
    AllowOverride All 
    Require all granted 
</Directory> 

我需要做什麼?

+0

請確保安裝PHP。 – Criesto

+0

@Criesto apt-get安裝php5 php-pear php5-mysql。結果> php5已經是最新版本了。 – Roman

+0

你重新啓動了Apache嗎? '服務apache2重啓' – Criesto

回答

0
<FilesMatch "\.phps$"> 
    SetHandler application/x-httpd-php-source 
</FilesMatch> 

替換:

<FilesMatch "\.php$"> 
    SetHandler application/x-httpd-php-source 
</FilesMatch> 

或更改應用程序類型:應用程序/八位字節流text/html或

+0

替換後沒有任何結果。 我應該在哪裏更改AppType? – Roman

+0

裏面FilesMatch標籤:SetHandler application/octet-stream –