今天在本机部署了一个pdo项目,发现一些问题,真没想到pdo mysql,不容易装啊,哈哈,我说的不容易,是因为php5.3以前版本,yum源里面根本没有。部署后就报,Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'。 1,从网上下pdo_mysql的扩展 下载地址:ht
今天在本机部署了一个pdo项目,发现一些问题,真没想到pdo mysql,不容易装啊,哈哈,我说的不容易,是因为php5.3以前版本,yum源里面根本没有。部署后就报,Undefined class constant 'MYSQL_ATTR_INIT_COMMAND'。
1,从网上下pdo_mysql的扩展
下载地址:http://pecl.php.net/package/PDO_MYSQL
具体安装请参考:phpize增加php模块
不建议用这种方式安装,看官网说明
Do not use this, as PDO has been moved into core (the php source) so this pecl extension is dead.
This old extension provided a MySQL driver for PDO.
pdo的模块已经封装到php的核心代码里面去了,编译安装的时候,激活就行了。
./configure --with-pdo-mysql --with-mysql-sock=/var/mysql/mysql.sock //mysql sock路径
2,yum安装pdo mysql
php我是用yum安装的,php版本是5.1的,当我安装pdo mysql的时候,报错
yum install php-pdo_mysql
报以下错误:php53-common conflicts with php-common
解决办法:把php-common卸载掉,装php53-common
yum remove php-common yum install php53-common php53 php53-pdo php-pdo_mysql
重起一下php-cgi就可以了。



Heiße KI -Werkzeuge

Undresser.AI Undress
KI-gestützte App zum Erstellen realistischer Aktfotos

AI Clothes Remover
Online-KI-Tool zum Entfernen von Kleidung aus Fotos.

Undress AI Tool
Ausziehbilder kostenlos

Clothoff.io
KI-Kleiderentferner

AI Hentai Generator
Erstellen Sie kostenlos Ai Hentai.

Heißer Artikel

Heiße Werkzeuge

PHPStorm Mac-Version
Das neueste (2018.2.1) professionelle, integrierte PHP-Entwicklungstool

Dreamweaver Mac
Visuelle Webentwicklungstools

Senden Sie Studio 13.0.1
Leistungsstarke integrierte PHP-Entwicklungsumgebung

MantisBT
Mantis ist ein einfach zu implementierendes webbasiertes Tool zur Fehlerverfolgung, das die Fehlerverfolgung von Produkten unterstützen soll. Es erfordert PHP, MySQL und einen Webserver. Schauen Sie sich unsere Demo- und Hosting-Services an.

SublimeText3 chinesische Version
Chinesische Version, sehr einfach zu bedienen