Linux php install pdo_mysql extension 1. confirm that the php environment has been configured, find the pdo_mysql extension directory of the php installation package, assuming that your installation package is under/lamp/php-5.2.6.
[Root @ localhost/] # cd/lamp/php-5.2.6/ext/pdo_mysql
[Root @ localhost pdo_mysql] #
[Root @ localhost pdo_mysql] # pwd
/Lamp/php-5.2.6/ext/pdo_mysql
[Root @ localhost pdo_mysql] #
2. assume that your php is installed in/usr/local/php. Run/usr/local/php/bin/phpize and run the following command:
[Root @ localhost pdo_mysql] #/usr/local/php5/bin/phpize
3. Compile .. /Configure -- with-php-config =/usr/local/php/bin/php-config -- with-pdo-mysql =/usr/local/mysql (assume that your mysql is installed in/usr/local/mysql)
[Root @ localhost pdo_mysql] #. /configure -- with-php-config =/usr/local/php/bin/php-config -- with-pdo-mysql =/usr/local/mysql
4. Compile and install the SDK. Make, make install
[Root @ localhost pdo_mysql] # make & make install;
5. after compilation, The/usr/local/php/lib/php/extensions will have an additional no-debug-non-zts-20060613 folder, which generates a pdo_mysql.so, modify php. ini, add the extension statement
Extension = "/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613 /";
Extension = pdo_mysql.so
6. restart apache and you will be able to see the support for pdo_mysql extension in the phpinfo information.
[Root @ localhost pdo_mysql] #/usr/local/apache2/bin/apachectl restart