|
PHP不能使用PGSQL解决办法 二维码
541
发表时间:2019-04-03 13:27 windows下解决wamper加载pgsql的问题/配置方法 > Copy 'libpq.dll' to the > Apache bin directory from the PHP directory > (/bin/php/ ). The reason for this is because PHP > is loaded as an Apache module, so any dlls that > the extensions require need to be copied to the > Apache bin directory. > > 1. Open 'config.inc.php' in any text editor. > 2. Do a search for '$phpDllToCopy' without the > single quotes. > 3. Add the following at the end of the line that > was found in step 2, exactly as written: > 'libpq.dll', > --- The edited line should look like the > following: $phpDllToCopy = array ( 'libpq.dll', > 4. Save 'config.inc.php' and refresh WampServer. 源文档 这是网上的解决方案 首先将php目录下的libpq.dll文件复制到apache的bin目录下 修改config.inc.php的文件在$phpDllToCopy数组中加入libpq.dll这一项 如图修改: config.inc.php文件在C:\WAMP\SCRIPTS\目录下,如图: 再将libpg.dll文件复制到系统盘的windows/system32目录下重新启动wamper 加载成功 这里libpg.dll文件用wamper安装后在php的安装目录就有匹配的版本,不要去下载了,直接复制过去! 测试一下 echo extension_loaded('pgsql'); 输出为1则加载成功了! 注: 如果还不行则检查一下确认php.ini文件是否启用了postgresql这一项,将:extension=php_pgsql.dll前面的引号去掉!在试试! --------------------- 作者:casey_chen 来源:CSDN 原文:https://blog.csdn.net/hainan89/article/details/6023342 |