linux php pdo mysql 扩展
今天在本机部署了一个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就可以了。



Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Causes and solutions for errors when using PECL to install extensions in Docker environment When using Docker environment, we often encounter some headaches...

The page is blank after PHP connects to MySQL, and the reason why die() function fails. When learning the connection between PHP and MySQL database, you often encounter some confusing things...

Solution to permission issues when viewing Python version in Linux terminal When you try to view Python version in Linux terminal, enter python...

Many website developers face the problem of integrating Node.js or Python services under the LAMP architecture: the existing LAMP (Linux Apache MySQL PHP) architecture website needs...

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

Regarding the problem of removing the Python interpreter that comes with Linux systems, many Linux distributions will preinstall the Python interpreter when installed, and it does not use the package manager...

Configure the apscheduler timing task as a service on macOS platform, if you want to configure the apscheduler timing task as a service, similar to ngin...

Using python in Linux terminal...
