Add pdo_mysql extensions to PHP under CentOS

Source: Internet
Author: User
Tags php and mysql zts
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.

  • 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.