0
0
0x6B72616B656E2012-05-11 14:02:41
PHP
0x6B72616B656E, 2012-05-11 14:02:41

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

11 answer(s)
A
Amadeusck, 2012-05-12
@Amadeusck

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

I
Ilya Plotnikov, 2012-05-11
@ilyaplot

/etc/php5/php-fpm/php.ini?

0
0x6B72616B656E, 2012-05-11
@0x6B72616B656E

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

0
0x6B72616B656E, 2012-05-11
@0x6B72616B656E

/etc/php/php-fpm.conf config posted on pastebin

G
gro, 2012-05-11
@gro

In php.ini connected PDO extension=pdo_mysql.so

Well, does phpinfo show the path to this php.ini?

0
0x6B72616B656E, 2012-05-11
@0x6B72616B656E

In both cases phpinfo(); shows
Loaded Configuration File -> /etc/php/php.ini

P
patashnik, 2012-05-11
@patashnik

Something incomprehensible is the nginx <-> apache <-> php-fpm link.
Do you have Apache configured via modphp or php-fpm? Nginx as proxy server?

0
0x6B72616B656E, 2012-05-12
@0x6B72616B656E

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!

S
smileart, 2013-01-23
@smileart

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?

M
mkEmperor, 2015-12-28
@mkEmperor

+1 to Amadeusck karma!

Y
Yuri Efin, 2016-07-02
@Gambits

apt-get install php5-mysql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question