选择PHP版本:
php 5.3的Windows版本要去专用的站点 http://windows.php.net/download/ 下载
选择版本时要参照官方的提示去做:
If you are using PHP with Apache 1 or Apache2 from apache.org you need to use the VC6 versions of PHP
如果你在Apache1或者Apache2跑php,那么你需要下载VC6版本的php
If you are using PHP with IIS you should use the VC9 versions of PHP
如果你在IIS下面跑php那么需要安装VC9版本的PHP
VC6 Versions are compiled with the legacy Visual Studio 6 compiler
VC6版本可以由老版本的Visual Studio 6编译
VC9 Versions are compiled with the Visual Studio 2008 compiler and have improvements in performance and stability. The VC9 versions require you to have the Microsoft 2008 C++ Runtime (x86) or the Microsoft 2008 C++ Runtime (x64) installed
VC9版本由Visual Studio 2008编译提高了效率和稳定性。VC9版本需要你有Microsoft 2008 C++ Runtime(32位或者64位)
Do NOT use VC9 version with apache.org binaries
别用Apache去跑VC9版本的PHP
如果没有安装Microsoft 2008 C++ Runtime那么php页面会报未知的Cgi错误:
系统日志会纪录
“D:\WebService\php-5.3.0-Win32-VC9-x86\php-cgi.exe”的激活上下文生成失败。 找不到从属程序集 Microsoft.VC90.CRT,processorArchitecture="x86",publicKeyToken="1fc8b3b9a1e18e3b",type="win32",version="9.0.21022.8"。 请使用 sxstrace.exe 进行详细诊断。
去微软官方下载安装Microsoft 2008 C++ Runtime后解决
32位版本
http://www.microsoft.com/downloads/details.aspx?FamilyID=9B2DA534-3E03-4391-8A4D-074B9F2BC1BF&displaylang=en
64位版本
http://www.microsoft.com/downloads/details.aspx?familyid=bd2a6171-e2d6-4230-b809-9a8d7548c1b6&displaylang=en
php.ini配置
主要配置和以前一样,只有下面一个问题要注意
date.timezone 一定要配置,否则会报错
date.timezone = Asia/Shanghai
php在IIS上FastCgi配置要点:
进入服务器的处理程序映射
添加模块映射来为FastCGI模块创建一个新的*.php的映射。
在打开的“添加模块映射”窗口中,在 request path中输入“*.php”,在module中选择“FastCGIModule”。在Executeable中选择你的PHP目录下的php- cgi.exe。你点击确定之后,会出现一个对话框,询问你是否要同时为创建一个FastCGI应用程序池。点击“yes”(确定),这将会自动创建运行 php-cgi.exe的配置环境,这对于每个FastCGI程序来说都是必须的。
MySQL配置:
在访问数据库的时候数据库返回以下信息:
mysqlnd cannot connect to MySQL 4.1+ using old authentication
原因(参见官方的更新文档)
The new mysqlnd library necessitates the use of MySQL 4.1's newer 41-byte password format. Continued use of the old 16-byte passwords will cause mysql_connect() and similar functions to emit the error, "mysqlnd cannot connect to MySQL 4.1+ using old authentication."
新的mysqlnd库需要使用MySQL 4.1新的41-byte的密码格式
使用旧的16字节的密码将导致mysql_connect()和类似的函数产生一个错 误:mysqlnd cannot connect to MySQL 4.1+ using old authentication. (mysqlnd不能用旧的验证方式来连接到MySQL 4.1以上的版本)
解决方法:
用命令行登陆mysql
输入语句 set password for ‘root’@'localhost’ = PASSWORD(’xxx’);
注意这里密码函数不是OLD_PASSWORD而是PASSWORD
另外MySQL的配置文件中不能出现 old-password=1
Xdebug安装
在php5.3里面xdebug安装方式基本与以前相同但是配置属性由
zend_extension_ts 变成了zend_extension
zend_extension =""c:/php/modules/php_xdebug-4.4.1-2.0.5.dll"
郁闷的是Xdebug 2.0.5在fastcgi模式下有兼容BUG,导致php崩溃,故暂时无法使用
xdebug官方bug记录
http://bugs.xdebug.org/view.php?id=454