Add Pdo_mysql to install separately

Source: Internet
Author: User

Add Pdo_mysql to install separately

Originally compiled PHP, did not put dpo_mysql related parameters, installed after the discovery. Re-compiling is a bit of a time, so decide to install it separately.

First look for 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

After execution, a mistake was reported:

Checking for mysql_config ... not found

Configure:error:Cannot find MySQL header files under


This error indicates that the system does not find your MySQL installation directory by default, so you can use this command to resolve:

Ln-s/usr/local/mysql/bin/mysql_config/usr/bin/mysql_config

This establishes the management of your actual MSYQL installation directory and the Mysql_config command

After configure, you can make it.

When executing:./configure, another problem arises:

Checking for PDO includes ... checking for PDO includes ...

Configure:error:Cannot find Php_pdo_driver.h.


Check the time, can not find php_pdo_driver.h, after inspection, found in reading Php-config time, in reading the previous configuration.

Workaround:./configure–with-php-config=/usr/local/php/bin/php-config (specified according to the actual path)

In the execution./configure--with-php-config=/usr/local/php/bin/php-config, another problem arises:

Error:mysql_query missing!?

Workaround:./configure--with-php-config=/opt/php5/bin/php-config--with-pdo-mysql=/usr/local/mysql

(depending on your actual path, set the location where MySQL was compiled and installed).

Make

Make install


Note the full path of Pdo_mysql, mine is:

/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so

And then in/usr/local/lib/php.ini

Add one sentence:

Extension=/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so


Restart Apache to see that the Pdo_mysql has been loaded successfully.

Lamp update under the problem there are many, this is only a part of it, if you have any similar problems, can be posted out, together to solve.


Add Pdo_mysql to install separately

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.