In your
php.ini file (it should be somewhere in
/etc (possibly in
/etc/httpd but you may have to look for it), there are sections that enable MySQL. Use a text editor and look for
mysql in that file (there are comments at each indicating whether or not to enable them; you remove a leading semicolon to enable, for example
Code:
[Pdo_mysql]
; If mysqlnd is used: Number of cache slots for the internal result set cache
; http://php.net/pdo_mysql.cache_size
pdo_mysql.cache_size = 2000 (the semicolon was removed here)
; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
; http://php.net/pdo_mysql.default-socket
pdo_mysql.default_socket= (and from here)
You must have the extension enabled:
Code:
; These are the extensions that are available for use on this PHP build.
; If you do NOT need any of these extensions, you should comment them out.
; That will probably increase both your security and performance.
<some extensions listed>
extension=iconv.so
extension=ldap.so
extension=mbstring.so
extension=mysql.so
extension=mysqli.so
extension=openssl.so
extension=pdo.so
extension=pdo_mysql.so
<some more extensions listed>
Of course your PHP installation must have been compiled to include MySQL functions (it usually is on most distributions -- yours may vary, however, and you need to check it). You may -- may -- need to build and install PHP from source if it was not configured to include MySQL. If necessary, you can execute PHP standalone; create a file,
phpinfo.php with this content
Code:
<?php
phpinfo();
?>
then execute it with
Code:
php phpinfo.php | grep -i mysql | more
You should see a lot of stuff that includes the string
mysql, most importantly
Code:
MySQL Support => enabled
Client API version => mysqlnd 5.0.8-dev - 20102224 - $Revision: 321634 $
mysql.allow_local_infile => On => On
mysql.allow_persistent => On => On
<plus a lot of other stuff>
If that's not there, your PHP installation was not compiled with MySQL enabled and you'll need to build PHP with MySQL enabled or find a package for your distribution that does have it enabled. That's not a trivial task, so check and make sure (with
phpinfo.php as described) before you undertake building PHP from source.
Hope this helps some.