CentOS6 How to let the installation configuration PDO support MySQL?
Project Run Tip: Undefined class constant ' Mysql_attr_init_command '
Similar problems on the network:
Prompt cannot select MySQL, after the query said it is necessary to support PDO.
Yum then install Php-pdo and then extension=/usr/lib64/php/modules/pdo.so in php.ini, restarting the system, but Phpinfo () still has only SQLite's PDO support.
Some of the information on the network is said to install Pdo_mysql, but Yum can not find, check PDO also only php-pdo one, so supposedly only need to install PHP-PDO, but this is not very clear (many years have not touched the Linux), how to let the installation configuration PDO support MYSQL, Please instruct the master.
# yum Install Php-mysql PHP.ini added again: extension=/usr/lib64/php/modules/pdo_mysql.so after restarting the server or not.
Continue:./configure also added "--with-pdo-mysql--with-mysql-sock=/tmp/mysql.sock", which displays information about PDO as well.
The last line of make install is: Installing PDO headers: Does/usr/local/php5/include/php/ext/pdo/mean that it has been compiled?
There is still no support after restarting the server. There is no configuration for SQLite in PHP.ini, why is there a display in Phpinfo ()?
Solve:
Enter the source code directory of PHP, find the Ext extension directory inside the Pdo_mysql;
Enter the Pdo_mysql directory and execute the following command:
/usr/local/php/bin/phpize
./configure--with-php-config=/usr/local/php/bin/php-config--with-pdo-mysql=/usr/local/mysql
Make
Make install
The installation was successful at this time;
Then go to php.ini file, add extension=pdo.so extension=pdo_mysql.so;
Restart the server to see the pdo_mysql extension in the phpinfo.
Installing the Pdo_mysql extension on Linux CENTOS6