windows下php配置apache

[list]
[*][color=red]注意:[/color] 记住当在 Windows 环境下的 Apache 配置文件中添加路径值时,所有的反斜线,如 c:\directory\file.ext,应转换为正斜线: c:/directory/file.ext。对目录来说,也必须由斜线结尾。
[/list]

在httpd.conf最后一行追加如下:
 # 
LoadModule php5_module "c:/php/php5apache2.dll"
AddHandler application/x-httpd-php .php

# configure the path to php.ini
PHPIniDir "C:/php"
#The above configuration will enable PHP handling of any file that has a .php extension,
#even if there are other file extensions. For example, a file named example.php.txt will be executed by the PHP handler.
#To ensure that only files that end in .php are executed, use the following configuration instead:
<FilesMatch \.php$>
SetHandler application/x-httpd-php
</FilesMatch>



[quote]<IfModule dir_module>
DirectoryIndex index.html
</IfModule>[/quote]
index.html 后面加上 index.php,变成:
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>


在php.ini最后加入:
# php timezone configure
date.timezone = "Asia/Shanghai"

date.default_latitude = 31.5167
date.default_longitude = 121.4500



[color=red]以上来自官方文档:[/color] [url]http://cn2.php.net/manual/zh/install.windows.apache2.php[/url]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值