Install pdo_mysql extension in php in linux

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.