Undefined class constant ' Mysql_attr_init_command '

Source: Internet
Author: User
Tags php framework phpinfo

The newly downloaded php3.23, local access to the database, can not be on the server. As follows:

:(

Undefined class constant ' Mysql_attr_init_command ' error location

FILE:/usr/local/apache/htdocs/chesudiwx/thinkphp/library/think/db/driver/mysql.class.php line:36

ThinkPHP3.2.3 {Fast & simple OOP PHP Framework}--[WE CAN do IT JUST THINK]

Workaround:

Open Pdo_mysql can be solved.
Windows platform: extension=php_pdo_mysql.dll;
Linux platform: extension=pdo_mysql.so;
If not, please use phpinfo to confirm Pdo_mysql is installed, if not found Pdo_mysql, need to install Pdo_mysql

First look at the local phpinfo:

Pdo_mysql
PDO Driver for MySQL enabled
Client API Version Mysqlnd 5.0.8-dev-20102224-$Revision: 321634 $

Then the server does not have pdo_mysql. But what the hell is this?

The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for the PHP Access database. Each database driver that implements the PDO interface can expose the characteristics of a specific database as a standard extension feature. Note that using PDO to extend itself does not enable any database functionality; You must use the PDO driver for a specific database to access the database service.

OK, look, it has to be installed.

1, wget http://pecl.php.net/get/PDO_MYSQL-1.0.2.tgz

2. Tar zxvf pdo_mysql-1.0.2.tgz

3. Configuring and Compiling files

CD pdo_mysql-1.0.2
/usr/local/php/bin/phpize
./configure–with-php-config=/usr/local/php/bin/php-config–with-pdo-mysql=/usr/local/mysql
Make
Make install

/usr/local/php5.5.30/lib/php.ini Add extension=pdo.so extension=pdo_mysql.so

Then restart the Web service, such as
Service httpd Restart
Service Nginxd Restart

Ok

Undefined class constant ' Mysql_attr_init_command '

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.