Although you might have done this already, could you create a php file with this content, and name it whatever you want. It will show the configuration you're using.
Code:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
// Show just the module information.
// phpinfo(8) yields identical results.
phpinfo(INFO_MODULES);
?>
You can run it manually with 'php -f filename.php' I dump it to a text file with '> name.txt' then use less to check it out. Piping to less did some funky things so this worked well for me.
You can also put that file in your /var/www/htdocs directory (or where ever your web server's root directory is) and use a browser to check out the config. On my ancient old laptop that has 12.2 on it, I'm seeing this at the top of the file: (although I wouldn't do this on a production server, or if I did, I wouldn't leave the file there for anything longer than what it takes to test)
phpinfo()
PHP Version => 5.2.11
System => Linux mars 2.6.27.31-smp #2 SMP Mon Aug 17 17:21:09 CDT 2009 i686
Build Date => Oct 2 2009 17:27:03
Configure Command => './configure' '--enable-force-cgi-redirect' '--enable-pcntl' '--enable-sigchild' '--prefix=/usr' '--libdir=/usr/lib' '--with-libdir=lib' '--sysconfdir=/etc' '--disable-safe-mode' '--disable-magic-quotes' '--enable-zend-multibyte' '--enable-mbregex' '--enable-tokenizer=shared' '--with-config-file-scan-dir=/etc/php' '--with-config-file-path=/etc/httpd' '--enable-mod_charset' '--with-layout=PHP' '--enable-sigchild' '--enable-xml' '--with-libxml-dir=/usr' '--enable-simplexml' '--enable-spl' '--enable-filter' '--disable-debug' '--with-openssl=shared' '--with-pcre-regex=/usr' '--with-zlib=shared,/usr' '--enable-bcmath=shared' '--with-bz2=shared,/usr' '--enable-calendar=shared' '--enable-ctype=shared' '--with-curl=shared' '--with-curlwrappers' '--enable-dba=shared' '--with-gdbm=/usr' '--with-db4=/usr' '--enable-dbase=shared' '--enable-exif=shared' '--enable-ftp=shared' '--with-gd=shared' '--with-jpeg-dir=/usr' '--with-png-dir=/usr' '--with-zlib-dir=/usr' '--with-xpm-dir=/usr' '--with-freetype-dir=/usr' '--with-t1lib=/usr' '--enable-gd-native-ttf' '--enable-gd-jis-conv' '--with-gettext=shared,/usr' '--with-gmp=shared,/usr' '--with-iconv=shared' '--with-imap-ssl=/usr' '--with-imap=/usr/local/lib/c-client' '--with-ldap=shared' '--enable-mbstring=shared' '--enable-hash' '--with-mhash=shared,/usr' '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '--enable-pdo=shared' '--with-pdo-mysql=shared,/usr' '--with-pdo-sqlite=shared' '--with-pspell=shared,/usr' '--with-mm=/usr' '--enable-shmop=shared' '--with-snmp=shared,/usr' '--enable-soap=shared' '--enable-sockets' '--with-sqlite=shared' '--enable-sqlite-utf8' '--with-regex=php' '--enable-sysvmsg' '--enable-sysvsem' '--enable-sysvshm' '--enable-wddx=shared' '--with-xsl=shared,/usr' '--enable-zip=shared' '--with-tsrm-pthreads' '--enable-shared=yes' '--enable-static=no' '--with-gnu-ld' '--with-pic' '--build=i486-slackware-linux'
Server API => Command Line Interface
Virtual Directory Support => disabled
Configuration File (php.ini) Path => /etc/httpd
Loaded Configuration File => /etc/httpd/php.ini
**************************************************
As you can see, there are a few configure options there indicating that mysql was compiled into php. Dunno -- it's been a while since I've set one of these damn things up, although it's only about a year, I forget things. I'm sure someone can explain that a little better than I can right now.
Further down the file, I see this:
mysql
MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => 5.0.67
MYSQL_MODULE_TYPE => external
MYSQL_SOCKET => /var/run/mysql/mysql.sock
MYSQL_INCLUDE => -I/usr/include/mysql
MYSQL_LIBS => -L/usr/lib -lmysqlclient
Directive => Local Value => Master Value
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off
mysqli
MysqlI Support => enabled
Client API library version => 5.0.67
Client API header version => 5.0.67
MYSQLI_SOCKET => /var/run/mysql/mysql.sock
Directive => Local Value => Master Value
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.reconnect => Off => Off
**********************************************************
I also see this in my php.ini file:
extension=mysql.so
extension=mysqli.so
which is pretty much what I would expect to see.
This is a standard install of Slackware on my laptop, too. I had to change the permissions on the rc.httpd file to fire it up.
I checked out the apache install on my Ubuntu system, which did involve installing php & a specific package for MySQL support -- which amounted to more or less a separate '.ini' file with this in it:
# configuration for php MySQL module
extension=mysql.so
These modules are already included with Slackare php packages from what it appears to me.
Let us know what your configuration looks like and we can go from there.