edfialk Posted February 6, 2007 Share Posted February 6, 2007 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 Quote Link to comment Share on other sites More sharing options...
arianhojat Posted February 6, 2007 Share Posted February 6, 2007 is php.ini set to load that extension? and is extension_dir pointing to where mysql.so in php.ini as well? Quote Link to comment Share on other sites More sharing options...
edfialk Posted February 6, 2007 Author Share Posted February 6, 2007 Thanks for quick reply. Yes they are. in php.ini: extension_dir = /var/www/html/extensions ... extension=mysql.so Quote Link to comment Share on other sites More sharing options...
arianhojat Posted February 6, 2007 Share Posted February 6, 2007 I'm not sure then, u said there were 2 versions of php's on the box, is there a php.ini for each? i'll let someone else tackle this one. Quote Link to comment Share on other sites More sharing options...
edfialk Posted February 6, 2007 Author Share Posted February 6, 2007 there is a php.ini for each, but I'm keeping them seperate, as well as the .so files for each. I knew this would be a toughy. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.