phpMyAdmin not loading MySQL extensions

Matthew Seaman m.seaman at infracaninophile.co.uk
Mon Feb 16 12:14:47 PST 2004


On Mon, Feb 16, 2004 at 12:31:28PM -0600, Tweax Daemon wrote:

>   
> I'm having trouble configuring phpMyAdmin.  I guess from when I try to view it
> in a browser I get the message unable to load mysql extensions the msql link
> re-directs me to the phpmyadmin site where its states about it can't load
> mysql.so  which is on my system I tried placing it in the same directory but
> that didn't work. Changing many things in the config.inc.php file but I still
> get the same error.  Has anyone been successful at getting phpMyAdmin to work on
> FreeBSD 4.8, if so please info me 

Works fine for me.  I assume you have compiled up php with the mysql
support included?  It's in the default configuration, so it should be
there even if you've installed packages from the FTP sites.  In any
case, look at the output of the phpinfo() function to verify that you
have compiled it with all of the right options:

    % /usr/local/bin/php << EOF | grep MySQL
    ? <? phpinfo() ?>
    ? EOF
    MySQL Support => enabled

Now it does sound as if you don't have libmysqlclient.so on your
library search path.  Try running these commands and compare the
output to what I get:

    % ldd /usr/local/libexec/apache/libphp4.so | grep mysql 
            libmysqlclient.so.12 => /usr/local/lib/mysql/libmysqlclient.so.12 (0x28608000)

    % ldconfig -r | grep mysql
            search directories: /usr/lib:/usr/lib/compat:/usr/X11R6/lib:/usr/local/lib:/usr/local/lib/mysql:/usr/local/lib/compat/pkg:/usr/local/lib/pth
            166:-lmysqlclient_r.12 => /usr/local/lib/mysql/libmysqlclient_r.so.12
            167:-lmysqlclient.12 => /usr/local/lib/mysql/libmysqlclient.so.12


At a guess the problem is that you don't have '/usr/local/lib/mysql'
on your shared library search path.  You can fix that (as a one-off)
by:

    # ldconfig -m /usr/local/lib/mysql

after which the ldd(1) and ldconfig(8) commands above should show
libmysqlclient.so being correctly located.  Then restart apache:

    # apachectl graceful

and the PHP module should pick up the required MySQL stuff.

Don't worry if the .so version number on your system is different --
I'm running mysql-4.0.18 which implies libmysqlclient.so.12.  Other
MySQL versions will be different.

You can preserve the ldconfig setup, or rather recreate it on each
reboot, by putting:

    ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib /usr/local/lib/mysql"

into /etc/rc.conf.

	Cheers

	Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
PGP: http://www.infracaninophile.co.uk/pgpkey         Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20040216/ba5e6dcd/attachment.bin


More information about the freebsd-questions mailing list