The first step: Enter the PHP source directory under the Ext/pdo_mysql directory (here is the source directory, not the installation directory, note the difference)
Step two: Execute: #{$php _indtall_dir}/bin/phpize
Note: here {$php _indtall_dir} refers to the installation directory of PHP, if installed to/usr/local/php, then execute/usr/local/php/bin/phpize, here is to generate. Configure compiled files
Step three: Compile the file:
./configure--with-php-c/span> #usr/local/php/bin/php-config--with-pdo-mysql=/usr/local/MySQL
Note: The directory of PHP and MySQL is the installation directory, modify it according to your own situation
Here also to make a soft link for MySQL header file, because MySQL installation when the installation directory specified, do not link, find the head file
#ln-S/usr/local/mysql/include/*/usr/local/include/
Then make && do install if successful you will be prompted:
Installing Shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
Fourth Step: Modify PHP.ini
Add the following two lines:
Extension=pdo_mysql
extensi>/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/
First step: Restart PHP-FPM, and Nginx or Apache can ^_^
The above describes the CentOS for PHP to add pdo_mysql extension, including aspects of the content, I hope that the PHP tutorial interested in a friend helpful.