安装apache
打开浏览器 localhost 显示
It works!
apache安装完成。
3、修改
httpd.conf
打开: D:\software\apache_php\Apache2.2\conf\httpd.conf
P179
DocumentRoot "D:/software/apache_php/Apache2.2/htdocs"
改为:DocumentRoot "D:/www"
P207
改为:
D:/www
">
设置默认文档(可不设)
P242 DirectoryIndex index.html
改为:DirectoryIndex index.html index.php
P474 #Include conf/extra/httpd-manual.conf
(去#号)改为:Include conf/extra/httpd-manual.conf
P131 增加代码
#指定php的ini文件,该文件是对php的一些配置
PHPIniDir "D:/software/apache_php/php"
AddType application/x-httpd-php .php .phtml
#让apache载入php处理模块
LoadModule php5_module D:/software/apache_php/php/php5apache2_2.dll
P391 增加 AddType application/x-httpd-php .php
4、修改
httpd-vhosts.conf
打开 D:\software\apache_php\Apache2.2\conf\extra\httpd-vhosts.conf
P29 DocumentRoot "D:/software/apache_php/Apache2.2/docs/dummy-host.localhost"
改为:
DocumentRoot
“
D:/www
”
P38 DocumentRoot "D:/software/apache_php/Apache2.2/docs/dummy-host2.localhost"
改为:
DocumentRoot
“
D:/www
”
5、修改 php.ini
打开
D:\software\apache_php\php
复制
php.ini-development 粘贴并更名为 php.ini
打开php.ini
P1008 ;date.timezone =
(去分号加参数)改为:date.timezone = PRC
P821 ; extension_dir = "ext"
(去分号改参数)改为: extension_dir = "D:/software/apache_php/php/ext"
P959-P976
;extension=php_bz2.dll
;extension=php_curl.dll
;extension=php_fileinfo.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_gmp.dll
;extension=php_intl.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_exif.dll ; Must be after mbstring as it depends on it
;extension=php_mysql.dll
;extension=php_mysqli.dll
;extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
;extension=php_openssl.dll
;extension=php_pdo_firebird.dll
(都去分号)改为:
extension=php_bz2.dll
extension=php_curl.dll
extension=php_fileinfo.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_oci8.dll ; Use with Oracle 10gR2 Instant Client
extension=php_oci8_11g.dll ; Use with Oracle 11gR2 Instant Client
extension=php_openssl.dll
extension=php_pdo_firebird.dll
重启apache环境
7、途中解答,如重启apache环境报错,这基本是因为第3步的增加代码有误
验证:
打开 D:\software\apache_php\Apache2.2\bin
点击空白处按shirft+右键
进入命令窗口,输入命令: httpd -t 回车
显示错误信息。