原料:apache2.4、php5/7
在apache的httpd.conf配置文件中加入以下,php5 和php7差不多:
# php5
PHPIniDir "D:\dev\env\php-5.6.28-x64"
LoadModule php5_module D:\dev\env\php-5.6.28-x64\php5apache2_4.dll
# php7
PHPIniDir "D:\dev\env\php-7.0.13-x64"
LoadModule php7_module D:\dev\env\php-7.0.13-x64\php7apache2_4.dll
設置mime類型,在 <IfModule mime_module>
中加入 AddType application/x-httpd-php .php
如:
<IfModule mime_module>
#
# TypesConfig points to the file containing the list of mappings from
# filename extension to MIME-type.
#
TypesConfig conf/mime.types
AddType application/x-httpd-php .php
...