System: LINUX
PHP Version: php5.6.9
Here are the detailed procedures:
1. First, download the pdo_mysql extension source package. The download page is here: Http://pecl.php.net/package/PDO_MYSQL.
# wget Http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
2. Then unzip.
# TAR-ZXVF Pdo_mysql-1.0.2.tgz
3. Enter the extracted directory and execute the phpize.
#/usr/local/php/bin/phpize
Configuring for:
PHP Api version:20131106
Zend Module Api no:20131226
Zend Extension Api no:220131226
4. Makefile is generated below. The following two parameters must be added, I did not add at the beginning, the results are not found in the Php-config and MySQL header files.
#./configure--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql=/usr/local/mysql
5. Make a soft connection to the header file of MySQL before making it. Because MySQL installs the time to specify the directory, does not make the soft connection, still cannot find the header file.
# ln-s/usr/local/mysql/include/*/usr/local/include/
6. Then make and make install.
# make
# make Install
7. You 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-20131226/
8. Modify the php.ini file (if you do not know the php.ini path can be found with Find/-name php.ini)
Modified: Extension_dir = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/" (Note: "/usr/local/php/lib/php/ extensions/no-debug-non-zts-20131226/"is the path configured in my server php.ini, if this path is not determined, you can phpinfo () check the" Extension_dir ", or directly copy the installation path of the output in step 7th)
Added: extension=pdo_mysql.so
9. Restart the httpd to reload the PHP configuration file
php5.6.9 Adding Pdo_mysql Extensions