PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Oct 15, 2018 2:01 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Jun 03, 2010 3:51 am 
Offline
Forum Commoner

Joined: Thu Nov 06, 2008 1:33 am
Posts: 58
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.

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.


Top
 Profile  
 
PostPosted: Fri Jun 04, 2010 4:05 am 
Offline
Forum Contributor
User avatar

Joined: Sat Oct 20, 2007 2:16 pm
Posts: 298
Location: York, England
It sounds like your configuration isn't finding PQescapeString in your PG libraries. Are you sure the libraries on your system (/usr/local/lib, most likely) are the same version as your development files?


Top
 Profile  
 
PostPosted: Fri Jun 04, 2010 1:31 pm 
Offline
Forum Commoner

Joined: Thu Nov 06, 2008 1:33 am
Posts: 58
Hi,

I php from source, so I assume it has the correct versions of everything. How do I check to make sure?

I did a complete format of my Ubuntu system and reinstalled everything - postgres, apache, and php.

I installed postgres from the postgres .bin installer, and apache and php from source; and the problem is still there.

I can read and write to the database from php, and my entire app works fine if I comment out the pg_escape_string() call.

thanks, any other sugestions? or (as a last resort) is there anywhere that I can find out what pg_escape_string does to a string so I can rewrite it myself in php?


Top
 Profile  
 
PostPosted: Fri Jun 04, 2010 1:49 pm 
Offline
Forum Commoner

Joined: Thu Nov 06, 2008 1:33 am
Posts: 58
I pg_escape_string() with addslashes(), are there any particular cases anyone knows of where addslashes will not function as desired? Why is pg_escape_string() recommended over the other?

This seems like it is a but in either the latest php or postgresql...since it exists after a fresh install. Any thoughts on that?

Thanks,

Raman


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group