Can anyone think of why this code would fail?
Pear is installed on the server in question at /usr/share/pear. I can connect to the database with mysql_connect() but not with DB::connect(). All the config info is correct but the DB::connect() routine fails silently. No error message but the script doesn't go past that call. Here's the code.
require_once("/usr/share/pear/DB.php");
$dbuser = "username";
$dbpass = "password";
$dbname = "dbname";
$dbhost = "localhost";
//make the connection...
$db = DB::connect( "mysql://$dbuser:$dbpass@$dbhost/$dbname" );
if (DB::isError($db)) {
die ($db->getMessage());
}
$db->setFetchMode(DB_FETCHMODE_OBJECT);
PEAR::setErrorHandling(PEAR_ERROR_DIE);
I have used this code one hundred times on other servers but on this particular server, it fails. Also, I have checked and all pear files are where they should be and all the classes are getting included. The code fails right at the connect line.
I thought maybe it was some server config thing that I might not know about. PHP version is 4.3.1 and all the goodies that should be required are installed. (seemingly)
Help me out.
Here's the configure stuff...
'./configure' 'i686-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-curl' '--with-db3' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-mcrypt' '--with-mm' '--with-openssl' '--with-png' '--with-pcre-regex=/usr' '--with-pspell' '--with-readline' '--with-regex=system' '--with-xml' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--disable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--enable-xslt' '--with-xslt-sablot=/usr' '--with-expat-dir=/usr' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-mnogosearch=shared,/usr' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs=/usr/sbin/apxs'