(done) Postgres - undefined function pg_escape_string
3 posts
• Page 1 of 1
(done) Postgres - undefined function pg_escape_string
Im trying to use the postgres database in my VS, project and im getting the error, undefined function pg_escape_string(). apparently/MAYBE it needs the Postgres version of libpq.dll.
Note: the web app is working fine in VS, until it get's to that function call.
I FOUND THIS COMMENT VIA GOOGLE,
-------------------------------
The PHP extension will look for libpq.dll which is found of your PostgreSQL installation. The simple fix is to add the path than contains that file to your environment PATH.
add to your enviroment variable "PATH" the bin folder of PostgreSQL installation: C:\Program Files\PostgreSQL\9.2\bin; (for example)
--------------------------------------
I tried that, but it didn't work. At least for IIS Express. I don't know.
Can anybody help?
K. Carter Sr.
Note: the web app is working fine in VS, until it get's to that function call.
I FOUND THIS COMMENT VIA GOOGLE,
-------------------------------
The PHP extension will look for libpq.dll which is found of your PostgreSQL installation. The simple fix is to add the path than contains that file to your environment PATH.
add to your enviroment variable "PATH" the bin folder of PostgreSQL installation: C:\Program Files\PostgreSQL\9.2\bin; (for example)
--------------------------------------
I tried that, but it didn't work. At least for IIS Express. I don't know.
Can anybody help?
K. Carter Sr.
- KCarterSr
- Posts: 1
- Joined: May 31st, 2018, 12:44 pm
Re: Postgres - undefined function pg_escape_string
The postgresql functions need the postgresql extension enabled. This is not turned on by default. So a couple of questions.
Did you edit your php.ini file to enable the extension? (Tools Menu -> options -> PHP Tools -> Interpreter gives you an easy way to get to your php.ini file from visual studio)
Are any of the other postgresql functions available?
Are you using at least Postgresql database version 7.2?
When you run php -m from the command line what do you see? Is pgsql on the modules list from that command?
All of this is related to how you installed and set up PHP![Smile :)](./images/smilies/icon_e_smile.gif)
Did you edit your php.ini file to enable the extension? (Tools Menu -> options -> PHP Tools -> Interpreter gives you an easy way to get to your php.ini file from visual studio)
Are any of the other postgresql functions available?
Are you using at least Postgresql database version 7.2?
When you run php -m from the command line what do you see? Is pgsql on the modules list from that command?
All of this is related to how you installed and set up PHP
![Smile :)](./images/smilies/icon_e_smile.gif)
- emsmith
- Posts: 12
- Joined: November 29th, 2017, 8:02 pm
Re: Postgres - undefined function pg_escape_string
HI,
indeed;
IntelliSense and the editor knowns `pg_*` functions however you have to enable it in your php.ini in order get it enabled in run time.
I hope it helps,
indeed;
IntelliSense and the editor knowns `pg_*` functions however you have to enable it in your php.ini in order get it enabled in run time.
I hope it helps,
Jakub Misek │ DEVSENSE s.r.o. | @misekjakub │ jakub@devsense.com │
-
Jakub Misek - Posts: 2092
- Joined: January 4th, 2012, 2:42 pm
- Location: Prague
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 54 guests