Home > php教程 > php手册 > body text

php 安装pdo

PHPz
Release: 2019-02-22 14:58:42
Original
2182 people have browsed it

如果pdo在linux下出现exception 'PDOException' with message 'could not find driver'则问题是php编译时少加

--with-pdo-mysql=/usr/local/mysql    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
Copy after login

编译安装PDO时出现致命错误:

/home/liujijun/software/PDO_MYSQL-1.0.2/php_pdo_mysql_int.h:25:19: 致命错误:mysql.h:没有那个文件或目录
 #include <mysql.h>
                   ^
Copy after login

编译中断。
make: *** [pdo_mysql.lo] 错误 1

解决:

在编译时需要MySQL的头的文件,默认搜索找不到头文件的位置,需要建立个软连接:

# ln -s /usr/local/mysql/include/* /usr/local/include/
Copy after login

相关mysql视频教程推荐:《mysql教程

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template