760176104 发表于 2017-1-6 11:59:13

apache+php最简单的配置方法

  1.首先下载php5,解压至 D:/Program Files/php/php5.2.8.
  2.只需要修改http.conf,修改这一句:

<IfModule dir_module>
DirectoryIndex index.php index.php3 index.html index.htm
</IfModule>
  3.在http.conf最末尾加入这一句:

Include "path/to/httpd/conf/extra/httpd-php.conf"
  4.新建path/to/httpd/conf/extra/httpd-php.conf文件:

LoadModule php5_module "D:/Program Files/php/php5.2.8/php5apache2_2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
DirectoryIndex index.php
PHPIniDir   "D:/Program Files/php/php5.2.8/"
  注意PHPIniDir   "D:/Program Files/php/php5.2.8/" 这一句是指定php.ini的路径,可以不必将php.ini放到windows目录;
  5.在apache中创建虚拟目录方法: 在http.conf最末尾加入这一句

Include "path/to/httpd/conf/alias/*"
  6. 然后在"path/to/httpd/conf/alias/*"中任意创建一个文件,内容:

Alias /bbs "d:/www/bbs/"
<Directory "d:/www/bbs/">
Options Indexes FollowSymLinks
#AllowOverride None
AllowOverride All
Order allow,deny
Allow from all
</Directory>
页: [1]
查看完整版本: apache+php最简单的配置方法