Answer the question
In order to leave comments, you need to log in
How to enable PDO in Php-fpm?
The server has Nginx which forwards requests to apach and php-fpm.
In php.ini connected PDO extension=pdo_mysql.so
phpinfo() on sites running on apache shows PDO drivers ->mysql
phpinfo() on sites running on php-fpm shows PDO drivers -> no value
ArchLinux OS. Why php-fpm does not include PDO driver and how to fix it?
Answer the question
In order to leave comments, you need to log in
Throw the file
pdo_mysql.ini
with the content
extension=pdo_mysql.so
into
/etc/php.d
php-fpm automatically connects configs from this directory. php.ini do not touch.
Check that there is a file
/usr/lib64/php/modules/pdo_mysql.so
Write down the result. If it does not help, we will think.
PS> Check the following files, they may have entered something wrong.
/etc/php-fpm.conf
/etc/php.ini
/etc/php-fpm.d/www.conf
Tried to restart. Did not help.
All files installed with php-fpm
php-fpm /etc/
php-fpm /etc/logrotate.d/
php-fpm /etc/logrotate.d/php-fpm
php-fpm /etc/php/
php-fpm /etc/ php/fpm.d/
php-fpm /etc/php/php-fpm.conf
php-fpm /etc/rc.d/
php-fpm /etc/rc.d/php-fpm
php-fpm /usr/
php- fpm /usr/sbin/
php-fpm /usr/sbin/php-fpm
php-fpm /usr/share/
php-fpm /usr/share/man/
php-fpm /usr/share/man/man8/
php-fpm /usr/share/man/man8/php-fpm.8.gz
In php.ini connected PDO extension=pdo_mysql.so
In both cases phpinfo(); shows
Loaded Configuration File -> /etc/php/php.ini
Something incomprehensible is the nginx <-> apache <-> php-fpm link.
Do you have Apache configured via modphp or php-fpm? Nginx as proxy server?
Module exists
/usr/lib/php/modules/pdo_mysql.so
Created file /etc/php/fpm.d/pdo_mysql.ini with pdo_mysql.ini Restarted
php-fpm and everything worked.
Thank you. Special thanks to Amadeusck!
There was a similar question, with the only difference that we are talking about OS X, where PHP 5.4 is installed using homebrew-php. Anyone?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question