来源URL:http://www.succw.com/operation/194
- IIS6
- PHP 5.2.17
- FastCGI
- MSSQL 2000
注意各种配置文件的权限
(php.ini,fcgiext.ini,php5目录等)
Windows PHP 各个版本: http://windows.php.net/downloads/releases/
FastCGI相关文件和路径 :
- C:\WINDOWS\system32\inetsrv\fcgiext.dll
- C:\WINDOWS\system32\inetsrv\fcgiext.ini
更改php.ini
1
2
3
4 | PHP开启支持FastCGI
cgi.force_redirect = 0
cgi.fix_pathinfo = 1
fastcgi.impersonate=1 |
php.ini通用设置:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 | short_open_tag = On
error_reporting = E_ALL & ~E_NOTICE
post_max_size = 16M
extension_dir = "c:\php5\ext"
upload_tmp_dir = "D:\php_upload" 上传的临时目录,自己建立目录,权限设定为:Administrators(完全控制)、System(完全控制)、IIS_WPG(读取和写入和删除)、ISUR_你的机器名(读取和写入和删除)
upload_max_filesize = 20M
max_file_uploads = 40
extension=php_bz2.dll
extension=php_curl.dll
extension=php_gd2.dll
extension=php_mbstring.dll
extension=php_mcrypt.dll
extension=php_mssql.dll #开启支持mssql
extension=php_mysql.dll
extension=php_mysqli.dll
extension=php_zip.dll
date.timezone = Asia/Shanghai
session.save_path = "D:\php_session" |
更改fcgiext.ini
1
2
3
4
5
6
7
8 | FastCGI开启支持php [ 追加下代码: ]
[Types]
php=[PHP]
[PHP]
ExePath=c:\php5\php-cgi.exe
#InstanceMaxRequests=10000
#ActivityTimeout=600
#RequestTimeout=600
#EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\php5\ |
IIS6配置相关:
1
2 | 右键 -> 属性 -> 主目录 -> 配置 -> 添加 ->可执行文件写上:
C:/WINDOWS/system32/inetsrv/fcgiext.dll,扩展名写上:.php,动作限制为:GET,HEAD,POST,TRACE |
测试你的配置环境:
1
2
3 | <?php
phpinfo();
?> |
php 5.4.26 + mssql 2000 方式与上有所不同。
官方在5.3之前提供mssql驱动。之后则需要第三方驱动。
微软官方 (sqlsrv_): http://docs.moodle.org/20/en/Using_the_Microsoft_SQL_Server_Driver_for_PHP
FreeTDS phpdblib.dll 详细安装下链接: http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP
php google上还找到了一个php提供php5.4.26驱动: 链接在此:http://downloads.php.net/pierre/sqlsrv-5.4-nts-snap.zip
参考链接:
connect php with mssql while using iis
http://stackoverflow.com/questions/13859282/connect-php-with-mssql-while-using-iis http://docs.moodle.org/20/en/Using_the_Microsoft_SQL_Server_Driver_for_PHP
windows php编译配置:
https://wiki.php.net/internals/windows/stepbystepbuild