I just found the reason for this annoying message. Every time I run PHP, it used to throw me a bunch of errors of the form:

PHP Warning: Module 'mysql' already loaded in Unknown on line 0

Warning: Module 'mysql' already loaded in Unknown on line 0
PHP Warning: Module 'mysqli' already loaded in Unknown on line 0

Warning: Module 'mysqli' already loaded in Unknown on line 0
PHP Warning: Module 'pdo_mysql' already loaded in Unknown on line 0

Warning: Module 'pdo_mysql' already loaded in Unknown on line 0

It was very irritating because I checked and re-checked my php.ini file to see if I was including the aforementioned modules more than once. So, if you are receiving these kinds of errors check to see if your php.ini file has something like

extension=mysql.so
extension=mysqli.so
extension=pdo_mysql.so

more than once. The trouble with PHP is that you could have many php.ini files on your system that you didn't know about. PHP CLI uses a different file than CGI and I also have many other PHP installations, for example those that came with Aptana IDE.

To find the .ini file you are interested in, the best you can do is to run "$ php -i" which basically calls phpinfo() and echoes the output. This will print out the .ini file it is using, allowing you to find the file causing trouble. Here's what I found:

Configuration File (php.ini) Path => /opt/local/etc/php5
Loaded Configuration File => /opt/local/etc/php5/php.ini
Scan this dir for additional .ini files => /opt/local/var/db/php5
Additional .ini files parsed => /opt/local/var/db/php5/apc.ini,
/opt/local/var/db/php5/curl.ini,
/opt/local/var/db/php5/mysql.ini,
/opt/local/var/db/php5/imagick.ini,
/opt/local/var/db/php5/memcache.ini,
/opt/local/var/db/php5/pecl_http.ini,
/opt/local/var/db/php5/readline.ini,
/opt/local/var/db/php5/tidy.ini,
/opt/local/var/db/php5/xdebug.ini,
/opt/local/var/db/php5/zlib.ini

Aha! So there's all the other .ini files that are included. I didn't know about this. So for my problem, the simple fix is removing the mysql.ini file from that directory. Everything is fine now. Enjoy :-)