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/