469,342 Members | 5,849 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,342 developers. It's quick & easy.

cannot load mysql extension - desperate

Hi all, I'm desperately trying to get a simple mysql connection
working in php 4.3.9 and I think I have a doozy for you guys. First
of all, I didn't set up ANY of this system, I'm just working with it.

So, on Redhat, we have two versions of PHP - Apache uses 4.3.9,
there's also a 4.4.2 that is default from command-line. 4.3.9 was
installed by RPM, 4.4.2 was built from source.

I can get mysql.so loaded and working fine in 4.4.2, but not in 4.3.9
(browser window).

The error on Apache startup:
PHP Warning: Unknown(): Unable to load dynamic library '/var/www/html/
extensions/mysql.so' - /var/www/html/extensions/mysql.so: cannot open
shared object file: No such file or directory in Unknown on line 0
But I assure you the file and directory are there:
[root@niceguy httpd]# ll /var/www/html/extensions
total 1620
-rwxr-xr-x 1 root root 319888 Feb 2 10:06 gd.so
-rwxr-xr-x 1 root root 45632 Feb 2 10:06 ldap.so
-rwxr-xr-x 1 root root 41108 Feb 2 15:42 mysql.so
-rwxr-xr-x 1 root root 1214134 Jan 19 10:24 php_mapscript.so
See that php_mapscript.so. That loads fiine, perfectly in fact.

Here's a little more info:
[root@niceguy httpd]# rpm -qa | grep "php"
php-ldap-4.3.9-3.22
php-mysql-4.3.9-3.22
php-gd-4.3.9-3.22
php-4.3.9-3.22
php-pear-4.3.9-3.22
So check this out:
[root@niceguy mapserver]# /usr/bin/php -v
PHP Warning: Unknown(): Unable to load dynamic library '/var/www/html/
extensions/mysql.so' - /var/www/html/extensions/mysql.so: undefined
symbol: php_sprintf in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library '/var/www/html/
extensions/mysql.so' - /var/www/html/extensions/mysql.so: undefined
symbol: php_sprintf in Unknown on line 0
PHP 4.3.9 (cgi) (built: Nov 2 2006 16:40:38)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
[root@niceguy mapserver]# cp /usr/lib/php4/mysql.so /var/www/html/
extensions
cp: overwrite `/var/www/html/extensions/mysql.so'? y
[root@niceguy mapserver]# /usr/bin/php -v
PHP Warning: Unknown(): Unable to load dynamic library '/var/www/html/
extensions/mysql.so' - /var/www/html/extensions/mysql.so: cannot open
shared object file: No such file or directory in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library '/var/www/html/
extensions/mysql.so' - /var/www/html/extensions/mysql.so: cannot open
shared object file: No such file or directory in Unknown on line 0
See what I did? First I put the 4.4.2 built from source mysql.so
connector into extensions directory and tried to load it - undefined
symbol is understandable, so then I moved the 4.3.9 (supposedly
working) version to my extensions and POOF file's not there.... You
can even see that I overwrote the file. So apache was reading it
before...but not now.

Again, desperate. Anyone got any ideas?
Thanks!
-Ed

Feb 6 '07 #1
1 2630
I've had that before, the install CD may not include all the
components for the PHP/MySQL you have to add in a module or two
doanloaded from RedHat to get the mysql.so file (I want to say it's
the php-mysql library but I could be mustaken)

If you are open to switching server OSs you might look at CentOS it's
a GPL derivative of RHEL4.and does a better job on providing PHP/MySQL
functionatilty off the discs.

Feb 6 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Kevin | last post: by
1 post views Thread by lithne | last post: by
1 post views Thread by David C. allen | last post: by
1 post views Thread by marknewbery | last post: by
5 posts views Thread by php-newbe | last post: by
reply views Thread by John Oliver | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.