PHP open PDO MySQL Extension module method detailed

Source: Internet
Author: User
Tags ini mysql version zts centos server zend

In the Windows Server

Locate the php.ini file for the PHP installation directory and then we search
Extension=php_pdo.dll this line to see if there is a semicolon in front of the line, and if so, remove it. and find out if there are any extension=php_pdo_mysql.dll. If so, remove the preceding semicolon as well. If not, add manually

The final two lines of configuration are as follows

Extension=php_pdo.dll
Extension=php_pdo_mysql.dll

The last reboot is Apahce/iis.

In the CentOS server

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.

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.

Make
Make install note the full path of the Pdo_mysql, and mine is:
/usr/local/php/lib/php/extensions/debug-non-zts-20060613/pdo_mysql.so
And then in/usr/local/lib/php.ini
Add a sentence:

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. (Successful test)

Related Article

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.