php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19856 missing function
Submitted: 2002-10-10 17:16 UTC Modified: 2002-10-17 21:11 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: cuek_saja at yahoo dot com Assigned:
Status: Not a bug Package: PostgreSQL related
PHP Version: 4.2.1 OS: Redhat Linux 7.x kernel 2.4.9-34
Private report: No CVE-ID: None
 [2002-10-10 17:16 UTC] cuek_saja at yahoo dot com
Using php v.4.2.1. 
All other postgres functions i've tried work but if i try to call pg_escape_string or pg_escape_bytea i get an undefined function error, like so...

Fatal error: Call to undefined function: pg_escape_string() in 

here's my configure command, in case it helps. 

'./configure' '--with-mysql' '--with-pgsql=/opt/pgsql' '--with-apxs=/usr/local/apache_1.3.26/bin/apxs' '--with-xml' '--with-gd=/opt/gd' '--enable-track-vars'


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-10 17:17 UTC] cuek_saja at yahoo dot com
psql (PostgreSQL) 7.2.1
 [2002-10-10 18:34 UTC] sniper@php.net
In main/php_config.h, is this defined:

HAVE_PQESCAPE

And if it isn't, check config.log for reason WHY
the check for it fails (search it for PQescapeString)

 [2002-10-10 18:58 UTC] cuek_saja at yahoo dot com
1st) thanks for the speedy help

It is defined but i checked config.log anyway, and there did seem to be an error.  Here's a snip from the log...

configure:52394: checking for PQescapeString in -lpq
configure:52413: gcc -o conftest -g -O2  -DLINUX=22 -DTARGET="httpsd" -DUSE_HSREGEX -DAPACHE_SSL  -Wl,-rpath,/opt/gd/lib -L/opt/gd/lib -L/opt/
pgsql/lib conftest.c -lpq  -lgd -lcrypt -lresolv -lm -ldl -lnsl  -lresolv -lcrypt 1>&5
/tmp/ccqMssoC.o: In function `main':
/usr/local/src/php-4.2.1/configure:52409: undefined reference to `PQescapeString'
collect2: ld returned 1 exit status
configure: failed program was:
#line 52402 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char PQescapeString();

int main() {
PQescapeString()
; return 0; }

----- end snippit -----

Any idea what caused it?

Should i just upgrade to php 4.3 and be done with it?
 [2002-10-10 20:08 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip

Okay, seems like your posgresql libraries do not have that
function. Are you SURE you have version 7.2.1 installed?

If so, try the PHP snapshot above. I'm not sure if there
was some bug in this in earlier PHP versions.

 [2002-10-10 22:41 UTC] cuek_saja at yahoo dot com
yes...

# psql --version
psql (PostgreSQL) 7.2.1
contains support for: readline, history, multibyte

# rpm -q postgresql
postgresql-7.2.1-2PGDG

---

However, I remember now that I installed in kind of a weird way.  Because the redhat RPMs annoyingly scatter everything instead of keeping packages intact in their own filesystem
i had to create /opt/pgsql under which i have the soft links include and lib which just point to /usr/lib and /usr/include which is where the postgresql RPM installed the postgres libraries.

Could I be missing something in that setup or could the rpm just not have the necessary function. 
(in which case upgrading isn't going to help right?)
 [2002-10-11 15:19 UTC] cuek_saja at yahoo dot com
I upgraded to 4.2.3 and it works now.
I suppose it is possible that when i compiled php 4.2.1 in July, that I had different postgres libs installed, but I do not remember upgrading postgres between then and now.
then again, my memory is not what it used to be,
and it never was much.
If it turns out this is not a bug, I apologize for going through the wrong system.
Thanks though, for your help.
 [2002-10-11 15:42 UTC] sniper@php.net
Duh..it's definately not any bug given the proper information (finally). Next time, try the latest versions of software before reporting any bugs.

 [2002-10-17 21:11 UTC] cuek_saja at yahoo dot com
Well, 
in my defense,
I stated what version i was running in the the info submitted.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Nov 04 05:01:28 2024 UTC