The need for additional PHP extensions may occur frequently during development and deployment, with Pdo_mysql, for example, under manual compilation to install the PHP extension:
First to http://pecl.php.net/to find the required version, I use a stable version. Take a look at the instructions first, especially the MySQL version of PHP.
Copy Code code as follows:
wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz
Tar xzvf pdo_mysql-1.0.2.tgz
CD pdo_mysql-1.0.2
/usr/local/php/bin/phpize
Configuring for:
PHP Api version:20041225
Zend Module Api no:20060613
Zend Extension Api no:220060519
./configure–with-php-config=/usr/local/php/bin/php-config
After configure, you can make it.
Copy Code code as follows:
Note the full path of the Pdo_mysql, and mine is:
Copy Code code as follows:
/usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
And then in/usr/local/lib/php.ini
Add a sentence:
Copy Code code as follows:
Extension=/usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
Restart Apache to see that the Pdo_mysql has been loaded successfully.