PostgreSQL trouble on windows PHP
I'm using WAMP on windows, which installs PHP, Apache and MySQL.
I'm now working on something new that requires PostgreSQL. The current install won't do it for me, as I keep getting these errors:
Call to undefined function pg_query()
Always
undefined function
I've installed PostgreSQL 8.3.7-1 for windows, added php_pgsql.dll
, php_pdo_pgsql.dll
and even libpq.dll
, which a note on the PHP page for postgreSQL says Windows users need starting from PHP 5.2.6
Still, I keep getting these errors...
Can someone advise the best course of action? Or should I just uninstall apache and everything else, and do a fresh install of each component seperatly?
xampp doesn't "tell" apache/php which php.ini to use. Therefore php uses its default lookup strategy to find the .ini file. If you haven't changed anything this will be the one in the directory where the apache binary is located, xampp/apache/bin/php.ini. Did you edit this file and removed the semicolon before extension=php_pgsql.dll ? When in doubt ask
echo 'php.ini: ', get_cfg_var('cfg_file_path');
which file you have to edit. xampp installs php as a module by default and you have to restart the apache in order to get php to read the php.ini again. After that
echo extension_loaded('pgsql') ? 'yes':'no';
should print yes. If it doesn't stop the apache service, open a command shell, go to your xampp directory and enter apache_start.batThis will start the apache as a console application and you can see startup errors in this console (instead of windows' event manager). If a dll is missing you will get a message box.
Did you enable it in the php ini file?
What does a call to phpinfo() say is installed for extensions?
根据您在Apache的error.log中看到的错误类型,这个问题的答案可能会有所帮助。
链接地址: http://www.djcxy.com/p/57742.html