Install pdo in php

Source: Internet
Author: User
If the pdo appears exceptionPDOExceptionwithmessagecouldnotfinddriver in linux, the problem is that php compilation is not followed by -- with-pdo-mysqlusrlocalmysqlwgetpecl.php.netgetPDO_MYSQL-1.0.2.tgztar-zxvfPDO_MYSQL-1.0.2.tgzcdPDO_MYSQL-1.0.2dat

If the pdo exception 'pdoexception' with message 'could not find driver 'appears in linux, the problem is that less -- with-pdo-mysql =/usr/local/mysql wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz is added during php compilation. tar-zxvf PDO_MYSQL-1.0.2.tgz cd PDO_MYSQL-1.0.2 // dat

If pdo encounters exception 'pdoexception' with message 'could not find driver 'in linux, the problem is that less -- with-pdo-mysql =/usr/local/mysql is added during php compilation.
Wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

Tar-zxvf PDO_MYSQL-1.0.2.tgz

Cd PDO_MYSQL-1.0.2/

/Data/klj/php/bin/phpize


./Configure -- with-php-config =/data/klj/php/bin/php-config -- with-pdo-mysql =/usr/local/mysql
Make & make install

A fatal error occurs during compilation and installation of PDO:

/Home/liujijun/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h: 25: 19: Fatal error: mysql. h: No file or directory
# Include
^
Compilation interrupted.
Make: *** [pdo_mysql.lo] Error 1

Solution:

MySQL header files are required during compilation. By default, the header file cannot be found and a soft connection is required:
# Ln-s/usr/local/mysql/include/*/usr/local/include/

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.