天天看點

出現通路apache資源直接下載下傳php檔案的解決辦法-----yum 安裝 php mysql

檢查apache下子產品擴充

yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml 

yum install mysql mysql-server mysql-devel

修改apache配置檔案加上如下二行

AddType application/x-httpd-php .php .phtml

AddType application/x-httpd-php-source .phps

重新開機apache

注意:2.4.2版本的apache中需要在目錄下面添加 Require all granted,否則無論怎麼通路都是403

<VirtualHost *:80>

   ServerName www.test.com

   ServerAlias test.com

   DocumentRoot /application/apache/htdocs

   <Directory /application/apache/htdocs>

     Options +indexes

     Order allow,deny

     Allow from all

     Require all granted

    </Directory>

</VirtualHost>

本文轉自cloves 51CTO部落格,原文連結:http://blog.51cto.com/yeqing/1735524