1.从www.php.net上下载最新的压缩包,然后解压到本地目录,然后将PHP目录追加到PATH环境变量下.
2.使用php.ini-recommended作为配置文件
3.配置文件定位,如果是使用APACHE,则可以通过PHPIniDir指标符配置;否则设置PHPRC环境变量
4.修改apache配置httpd.txt文件内容,加载PHP模块,
# For PHP 5 do something like this:
LoadModule php5_module "d:/php5/php5apache2_2.dll"
AddType application/x-httpd-php .php
# configure the path to php.ini
PHPIniDir "d:/php5"
5.启用mysql
修改PHP.INI文件,将extension=php_mysqli.dll的注释去掉,并修改extension_dir = "./ext" ;由于没有把libmysql.dll拷贝到apache/bin目录下,一打开网页apache就崩溃;PHP各个模块的依赖关系可以参考http://cn.php.net/manual/en/install.windows.extensions.php
6.xdebug配置
从www.xdebug.org上下载php_xdebug.dll并将它放入PHP的EXT目录下,然后在PHP.INI下加入如下语句
[Xdebug]
zend_extension_ts = "d:/php5/ext/php_xdebug.dll"
xdebug.auto_trace = On
xdebug.collect_params = On
xdebug.collect_return = On
xdebug.remote_enable = On
xdebug.remote_host = 127.0.0.1 --这一项和PORT项目如何不设置,会出现waiting for xdebug的错误
xdebug.remote_port = 9000
xdebug.remote_handler = dbgp
xdebug.remote_log = "d:/logs"
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = "d:/logs"