• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

php-fastcgi - ALL domains

podman99

Basic Pleskian
Hi,

Is there any risks or downside to having all of my vhosts setup to use PHP as FastCGI rather than an apache module?

Is there any CPU boost to doing this?

And .... most importantly, how can I apply this new configuration to ALL of my vhosts and if possible remove the apache module option. (I know that once moved to fcgi I can run a2dismod php5 and it will stop apache loading it.)
 
Hi podman99,

FastCGI is better if your php websites have significant web requests load.
As for change PHP handler for existent domains - this is not trivial task
 
Thanks Alexey,

I have nearly 1000 Domains on that server, some with fastcgi enabled and some set to apache module.

Do you have a command line I can run which would include all of my domains... I know the one domain command is

/opt/psa/bin/domain --update localdomain.blah -php_handler_type fastcgi

However, all of my domains are in the plesk database, do you have a nice one liner which would work this magic :)
 
After doing a server migration I needed all the new sites to be running under fastcgi

So I did

UPDATE `hosting` SET php_handler_type = 'fastcgi'

in the "psa" database.

Then re-built all the apache configs using:

/usr/local/psa/admin/bin/httpdmng --reconfigure-all

Then restarted apache

service apache2 restart

doneski

edit: make sure you delete the existing "apache" sessions in /var/lib/php/sessions/ otherwise any active php scripts with those sessions will be unable to write to them any more
 
Last edited:
Back
Top