swraman Posted June 3, 2010 Share Posted June 3, 2010 I get this error when I run a webapp Im trying to use: Fatal error: Call to undefined function pg_escape_string() in ... I know the application works, as Ive been developing and modifying it for a while now. Im trying to get it running on my Linux desktop so editing will be easier. My server setup: -Apache2 on Linux (Ubuntu) -PHP 5.3.2 -PostgreSQL 8.4 PHP IS CONFIGURED to use postgres, I know thats the most obvious thing that stands out with this problem, but I did configure PHP with: './configure' '--with-apxs2=/usr/local/apache2/bin/apxs' '--with-pgsql=/opt/PostgreSQL/8.4/' and in phpinfo It has a section for "PostgreSQL Support"; and if I run php -m pgsql is on the list of installed modules. I can use other PG commands, and can connect to a postgres server and such. This function doesnt work though. Im completely baffled. If it makes any difference, I had PHP 5.3.1 installed earlier, and I got this error; then I downloaded/compiled/installed 5.3.2 to see if it fixed it, but it didn't. Thanks, any help appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/203791-fatal-error-call-to-undefined-function-pg_escape_string/ Share on other sites More sharing options...
premiso Posted June 3, 2010 Share Posted June 3, 2010 It may be configured, but you also have to enabled the extension in the php.ini. Check that the extension is uncommented (does not have a ; infront) if it is not uncommented, uncomment it and restart the server. Quote Link to comment https://forums.phpfreaks.com/topic/203791-fatal-error-call-to-undefined-function-pg_escape_string/#findComment-1067309 Share on other sites More sharing options...
swraman Posted June 3, 2010 Author Share Posted June 3, 2010 It is enabled, I can use other pgsql functions. It onnects to a postgresql server fine, its just this function doesnt work. Thanks, any other sugestions? Quote Link to comment https://forums.phpfreaks.com/topic/203791-fatal-error-call-to-undefined-function-pg_escape_string/#findComment-1067400 Share on other sites More sharing options...
PFMaBiSmAd Posted June 3, 2010 Share Posted June 3, 2010 Have you completely deleted the pg_escape_string from the source and retyped it in case you have some non-printing characters as part of the name in the source? Quote Link to comment https://forums.phpfreaks.com/topic/203791-fatal-error-call-to-undefined-function-pg_escape_string/#findComment-1067403 Share on other sites More sharing options...
swraman Posted June 4, 2010 Author Share Posted June 4, 2010 Tried retyping it...still not working. I got frustrated (and since Im not extremely farmiliar with Linux) just formatted my entire Ubuntu partition. I reinstalled pgSQL, Apache, and PHP, and it STILL gives me the same error! Is this a more widespread problem? I havent read anything about it anywhere. If this really can't be fixed, I can write a substitute function for pg_escape_string, but I really want to get this fixed. thanks Raman Quote Link to comment https://forums.phpfreaks.com/topic/203791-fatal-error-call-to-undefined-function-pg_escape_string/#findComment-1067537 Share on other sites More sharing options...
artacus Posted October 27, 2010 Share Posted October 27, 2010 *Returns from long absence* Just wanted to reply in case someone has the same issue later. I'm sure the problem here is one of parameter types. Just cast your param to text and it'll work. Quote Link to comment https://forums.phpfreaks.com/topic/203791-fatal-error-call-to-undefined-function-pg_escape_string/#findComment-1127142 Share on other sites More sharing options...
yclick Posted June 5, 2012 Share Posted June 5, 2012 Ok it's a old thread, but it's the first result in google for "pg_escape_identifier undefined function"; so i'm replying. http://www.php.net/manual/fr/function.pg-escape-identifier.php It's shows : (No version information available, might only be in SVN) I can't understand why, but it's so. And i also can't use this function. (I use addcslashes($f, '"') instead...) Quote Link to comment https://forums.phpfreaks.com/topic/203791-fatal-error-call-to-undefined-function-pg_escape_string/#findComment-1351330 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.