See the cake document required to install the pdo_mysql extension, so try to install it.
Here my system is CentOS 6.0. If your system is another version of the Linux/unix, you can refer to it. If your system is windows, sorry, the following content is not suitable for you, please go.
The first is to download the Pdo_mysql extended source package. Download the page here: Http://pecl.php.net/package/PDO_MYSQL. You can download it and upload it to the server using FTP.
I downloaded it directly to the server side using wget after copying the download address.
# wget Http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
And then the decompression.
# TAR-ZXVF Pdo_mysql-1.0.2.tgz
Go to the unpacked directory and execute phpize.
PHP Api version:20100412
Zend Module Api no:20100525
Zend Extension Api no:220100525
The following generates makefile. The following two parameters must be added, at the beginning I did not add, the results are prompted to find Php-config and MySQL header file.
Make a soft connection to the header file of MySQL before making. Because the MySQL installation specified the directory, do not make a soft connection, or can not find the header file.
Then make and make install.
# make Install
It will then be prompted as follows, meaning that the extension is installed in the following directory.
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-zts-20100525/
For convenience, I moved the pdo_mysql.so file to the extensions directory.
You can then modify the php.ini file.
Find Extension_dir = "./" This line, remove the annotation, and modify the path.
Extension_dir = "/usr/local/php/lib/php/extensions/"
After I tested this, I found that PHP only looks for extensions so from this directory, not subdirectories in that directory. So I moved the so file to the directory for unified Management.
Find Extension=php_pdo_mysql.dll this line, remove the annotation, and modify the file name that follows.
File name is not the same, here to remove the PHP_ prefix, or can not find the file. The later DLL is the name of the file under Windows, and we change to so.
Finally reboot the Apache is OK. Use Phpinfo () to see that the discovery is in effect.
Pdo_mysql The following operations are done under Linux system
1, download files or enter the PHP source package into the Ext/pdo_mysql
2, Extract files
Tar zxvf pdo_mysql-1.0.2.tgz
3. Configure and Compile files
Note: My PHP installation in:/usr/local/php/mysql installed in:/usr/local/mysql compile time to pay attention to your own installation directory where
3, install to the PHP configuration
Keep this in mind, and then open the php.ini file,
and add a row
Windows PDO MySQL Extended installation
PHP.ini does not open the PDO, so modify the php.ini, will be shaped like the following code before removing the semicolon, modified as follows:
Extension_dir= "E:/amp/php/ext"//here is configured for your own ext directory path
After restarting Apache, the access continues to report the following error:
Cdbconnection cannot open database connection: Could not find driver
It means that you can't find the database driver, and I looked at it with Phpinfo, and PDO really turned on, but PDO the database supported in that item shows no value, which means that the php_pdo_mysql.dll extension cannot be loaded. After several attempts, including replacing the version of PHP, replace the MySQL version. But none worked. Can't you really turn on PHP's MySQL PDO extension?
I checked it on the Internet, and I finally found a solution.
Method One: You need to add the path of the PHP installation directory to the system environment variable path, which solves the problem.
Method Two: Because I was deployed on the server, running the server, so can not reboot, so you can also copy the PHP installation directory Libmysql.dll under the Windows directory