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 '