By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,722 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,722 IT Pros & Developers. It's quick & easy.

cannot load mysql extension - desperate

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.