.php 文件显示为源代码

.php 文件显示为源代码

我已经安装了一个默认的LAMP:

ubuntu 16.04
Apache2
MySQL 5.7
PHP 7.0

默认站点 PHP 正常运行。

000-default.conf 
<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

但是当我添加虚拟主机时,.php 显示为原始代码:

test.mysite.conf 
<VirtualHost *:80>
    ServerName test.mysite.com
    DocumentRoot "/var/www/test"

   <Directory "/var/www/test">
       Options Indexes FollowSymlinks MultiViews
       AllowOverride All
       Require all granted
       DirectoryIndex index.php
   </Directory>

   <FilesMatch "\.php$">
       Require all granted
       SetHandler proxy:fcgi://127.0.0.1:9000
   </FilesMatch>

   ErrorLog "/var/log/apache2/test.my_error.log"
   ServerSignature Off
   CustomLog "/var/log/apache2/test.my_access.log" combined 

   SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
</VirtualHost>

有人能帮忙解决上述错误或其他文件错误吗?

提前致谢

相关内容