• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 865
  • Last Modified:

Fatal error: Call to undefined function using ODBC on a Red Hat Enterprise 4 Server

We are trying to set up PHP/Apache on a Red Hat Enterprise 4 server to connect via ODBC to a Progress V10 database on an AIX server.  I can successfully run a PHP test page from the command line and get successful results.  When I run the same page through the browser I get the following error in the Apache log:

[client x.x.x.x] PHP Fatal error:  Call to undefined function:  
odbc_connect() in /var/www/html/bgtest2.php on line 15

Versions we are running:
php-4.3.9-3.8
php-mysql-4.3.9-3.8
php-pear-4.3.9-3.8
php-odbc-4.3.9-3.8
httpd-2.0.52

We have compiled it with and without mySQL support.  Ideally, we would like to connect to both mySQL and Progress but I can work aound not having mySQL if that is an issue.

Any help would be greatly appreciated.
0
bsg999
Asked:
bsg999
  • 3
  • 2
1 Solution
 
gamebitsCommented:
Make sure you define the connection parameter in the odbc_connect() function

From http://ca.php.net/odbc_connect


resource odbc_connect ( string dsn, string user, string password [, int cursor_type] )


Returns an ODBC connection id or 0 (FALSE) on error.

The connection id returned by this functions is needed by other ODBC functions. You can have multiple connections open at once as long as they either use different db or different credentials. The optional fourth parameter sets the type of cursor to be used for this connection. This parameter is not normally needed, but can be useful for working around problems with some ODBC drivers.

Gamebits
0
 
bsg999Author Commented:
The connection parameters are correct . I get sucessful results when I run "php /var/www/html/bgtest2.php" from the command line.  The error occrs when I attemp to load the page in the browser using the apache web server.
0
 
gamebitsCommented:
Did you compile php with ODBC support?

Gamebits
0
 
bsg999Author Commented:
Yes.  If there was a path problem or any other problem with the compile would it work from the command line?  I had first suspected a problem with the compile with ODBC support but the fact that it worked from the command line pointed me in a different direction.  I am using the Merant ODBC driver provided with Progress's SQL Client Access product.  Is it worth trying iodbc?
0
 
gamebitsCommented:
Yes, i think it's worth it.

Gamebits
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now