复制C:\php\php.ini-dist到windows安装目录下(如:c:\windows),并将其改名为php.ini。用记事本打开,修改一下信息:
搜索extension_dir = ./ 这行,并将其路径指到你的PHP目录下的extensions目录,比如:
extension_dir = C:\php\extensions
如若想支持更多模块,,搜索:
;Windows Extensions
;Note that MySQL and ODBC support is now built in, so no dll is needed for it.
;
下面都用分号在前面注释掉了支持的扩展模块,如果你想PHP支持某个模块,请将前面的“;”去掉即可
修改完成后,保存php.ini,到此完成PHP的安装和配置。
我们在下面加入一行
extension=php_mysql.dll
//Note 1: The extension dir need not be ".\", as Hermawan mentioned. It works fine for me with the extensions subdir where the other extensions are located.
//Note 2: The php.ini file need not be in the Apache root, as lars mentioned. It works fine for me in the Windows dir.