Add pdo_mysql extension for php in centos

Source: Internet
Author: User
: This article mainly introduces how to add pdo_mysql extension for php in centos. if you are interested in the PHP Tutorial, refer to it. Step 1: Go to the ext/pdo_mysql directory under the php source code directory (here is the source code directory, not the installation directory, note the difference)

Step 2: Run: # {$ php_indtall_dir}/bin/phpize

Note: Here {$ php_indtall_dir} refers to the php installation directory. if/usr/local/php is installed, run/usr/local/php/bin/phpize, here is the generation. configure

Step 3: compile the file:

./Configure -- with-php-c/span> # usr/local/php/bin/php-config -- with-pdo-mysql =/usr/local/mysql

Note: Both the php and mysql directories are installation directories, which can be modified as needed.

Here we also need to make a soft link for the mysql header file, because the installation directory is specified during mysql installation, no link is left, and the header file cannot be found.

# Ln-s/usr/local/mysql/include/*/usr/local/include/

Then, if make & make install is successful, a prompt is displayed:

Installing shared extensions:/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

Step 4: modify php. ini

Add the following two rows:

Extension = pdo_mysql

Extensi>/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/

Step 1: restart php-fpm and restart nginx or apache.

The above introduces how to add pdo_mysql extension for php in centos, including some content. I hope my friends who are interested in PHP tutorials can help me.

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.