After upgrading to php 7.2 the pgsql driver is "randomly" not found
Hi everyone,
I'm running Laravel 5.5. I used to run php 7.1, then I had to upgrade it to 7.2 due to other app (running on the same webserver) requirements.
I've uninstalled all php7.1 packages and installed the 7.2 corresponding versions, including php7.2-pgsql.
I've enabled the php modules. Running php -i | grep pgsql I get:
/etc/php/7.2/cli/conf.d/20-pdo_pgsql.ini,
/etc/php/7.2/cli/conf.d/20-pgsql.ini,
PDO drivers => pgsql
pdo_pgsql
pgsql
pgsql.allow_persistent => On => On
pgsql.auto_reset_persistent => Off => Off
pgsql.ignore_notice => Off => Off
pgsql.log_notice => Off => Off
pgsql.max_links => Unlimited => Unlimited
pgsql.max_persistent => Unlimited => Unlimited
I've restarted apache.
I access my production site. For the same call (I see the calls reloading the page) I -seems randomly- get pgsql - driver not found errors from Laravel.
The very wired thing is that this happens ~ 50% of times without any regular pattern.
This is of course highly affect my production deployment. Any help would be highly appreciated.
Thanks a lot for the reply. Indeed, simply the reboot solved the issue.
I don't understand few things here, and I'll probably need a good search on Google. If you can give me some basic highlights it would be great:
what is the php-fpm cache?
In general, I still didn't really understood if I should or not enable fpm for my server. Thoughts? Is this something that has to do with Apache? Php itself? Both?
I think I've seen a message during some installation (either Apache or PHP) telling me that fpm wouldn't have be activated by default..how do I check if fpm is on?
As said, all things that I can for sure Google, just looking for high level replies, and specially suggestions on fpm. The most important thing is that for now I've solved, so again thanks!
Php-fpm creates and manages a pool of php processes, also called workers that receive and server requests to execute php files from the web directory. Fpm runs a separate pools for each of your applications, with the default setup of course.
However when you install a new PHP version, the old pools are not cleared and still used. By default the processes in the pool are not deleted and therefor your server returns the old website. When clearing the pools or by restarting nginx it will clear these pools and the new site will be used. Restarting php-fpm works most of the time as well ;)
I can't be really specific here for your server, because I have no idea how it's setup. I hope this helped a bit :D