Home  >  Article  >  Backend Development  >  Centos6.5 has pdo_mysql installed or there is no pdo_mysql

Centos6.5 has pdo_mysql installed or there is no pdo_mysql

WBOY
WBOYOriginal
2016-12-01 00:56:281107browse

I successfully installed pdo_mysql and restarted php-fpm, but there is no pdo_mysql. What is the error? Baidu contacted me and said that the php.ini path is wrong. I put php.ini under /php/etc. Where to put it? How to configure?
Centos6.5 has pdo_mysql installed or there is no pdo_mysql
Centos6.5 has pdo_mysql installed or there is no pdo_mysql
Centos6.5 has pdo_mysql installed or there is no pdo_mysql
Centos6.5 has pdo_mysql installed or there is no pdo_mysql
Centos6.5 has pdo_mysql installed or there is no pdo_mysql

Reply content:

I successfully installed pdo_mysql and restarted php-fpm, but there is no pdo_mysql. What is the error? Baidu contacted me and said that the php.ini path is wrong. I put php.ini under /php/etc. Where to put it? How to configure?
Centos6.5 has pdo_mysql installed or there is no pdo_mysql
Centos6.5 has pdo_mysql installed or there is no pdo_mysql
Centos6.5 has pdo_mysql installed or there is no pdo_mysql
Centos6.5 has pdo_mysql installed or there is no pdo_mysql
Centos6.5 has pdo_mysql installed or there is no pdo_mysql

Check the directory in the Configuration File Path to see if there is php.ini.
If the php.ini file does not take effect, you can use the -c parameter when starting php-fpm

Recompile and give it a try
Add the parameter --with-pdo-mysql=$MYSQL_BASE

Thanks for the invitation
Yes, your php.ini path is wrong, because your PHP did not actively specify the path of the configuration file when compiling. Looking at your screenshot, now php.ini reads The path taken is /usr/local/php/lib, and you placed the file under /usr/local/php/etc.
Solution:

  1. Move php.ini to /usr/local/php/lib/php.ini, then restart

  2. Recompile PHP, add compilation parameters --with-config-file-path=/usr/local/php/etc, and add --with-pdo-mysql=mysqlnd

extension="pdo_mysql.so" Follow the absolute path of the dynamic library and restart php-fpm

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn