Linux安全网 - Linux操作系统_Linux 命令_Linux教程_Linux黑客

会员投稿 投稿指南 本期推荐:
搜索:
您的位置: Linux安全网 > Windows服务器 > » 正文

windows下php配置apache

来源: ling凌yue月 分享至:
   
  • 注意: 记住当在 Windows 环境下的 Apache 配置文件中添加路径值时,所有的反斜线,如 c:\directory\file.ext,应转换为正斜线: c:/directory/file.ext。对目录来说,也必须由斜线结尾。


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>



引用<IfModule dir_module>
    DirectoryIndex index.html
</IfModule>
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



以上来自官方文档: http://cn2.php.net/manual/zh/install.windows.apache2.php

Tags:
分享至:
最新图文资讯
1 2 3 4 5 6
验证码:点击我更换图片 理智评论文明上网,拒绝恶意谩骂 用户名:
关于我们 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 发展历史