首页 > php代码 > 如何在Windows 下配置 PHP 环境教程

如何在Windows 下配置 PHP 环境教程

1. 所需软件环境:

1. apache 2.2 

2. active perl 5.8 c:\perl

3. php 5.1 必须安在 c:\php

4. ZendOptimizer-3.0.2 

5. php环境所需 includes --在 php 安装之后,无法正常运行时必须的库。

-----------------------------------------------

2. apache 2.2--------httpd.conf 文件配置

1. 第133行前面加 #

2. 修改 <IfModule alias_module> </IfModule> 之间

ScriptAlias /cgi-bin/ "D:/Programmes/Server/Apache2.2/cgi-bin/"

<Directory "D:/Programmes/Server/Apache2.2/cgi-bin">

划线部分分别改为 C:/php/ 和 C:/php

3. 将 #!c:/program files/perl/perl 改为 #!C:/Perl/bin

4. 在文件末尾添加

ScriptAlias /php/ "c:/php/"

AddType application/x-httpd-php .php

# For PHP 4

#Action application/x-httpd-php "/php/php.exe"

# For PHP 5

Action application/x-httpd-php "/php/php-cgi.exe"

-------------------------------------------------------------------------------

3. php配置细则:

1. 将 c:php 加入 windows 环境变量 path 中

2. 将 includes 拷入 c:\phpincludes

3. 将 php.ini-dist 改名为 php.ini

4. 下面是 php.ini 配置细则:

1. 将 doc_root = 设置为 doc_root = D:ProgrammesServerApache2.2htdocs

2. 将 extension_dir = 设置为 extension_dir = "C:\phpext"

3. 将 ;extension=php_mysql.dll 前面的 ”;” 去掉,改为 extension=php_mysql.dll

4. 在 ; Windows: "path1;path2" 下面 的 include_path = 改为

include_path = ".;c:\phpincludes"

5. 对 [MySQL] 下面进行配置

4. active perl 安装很简单照着指示做就可以 最好安到 c:\perl

5. ZendOptimizer 安装时把 apache 服务器关掉,在过程中要指定 apache 和 php 的安装路径。

<? phpinfo() ?>


本文地址:http://www.phprm.com/code/f9569ff8e9f6f45d6698b049b9f6c725.html

转载随意,但请附上文章地址:-)

标签:none

发表留言