Differences and dis/advanages between: Fast-CGI, CGI, Mod-PHP, SuPHP, PHP-FPM

CGI and FastCGI are two protocols not specific to PHP: CGI scripts is a way how to run a server side script (not only PHP!) when a HTTP request arrives. In this setup, the web server launches a new CGI process for every incoming request, causing significant performance overhead. FastCGI is a “better CGI” – … Read more

Nginx 1 FastCGI sent in stderr: “Primary script unknown”

The error message “primary script unknown” is almost always related to a wrongly set SCRIPT_FILENAME in the nginx fastcgi_param directive (or incorrect permissions, see other answers). You’re using an if in the configuration you posted first. Well it should be well known by now that if is evil and often produces problems. Setting the root … Read more

How do you restart php-fpm?

Note: prepend sudo if not root Using SysV Init scripts directly: /etc/init.d/php-fpm restart # typical /etc/init.d/php5-fpm restart # debian-style /etc/init.d/php7.0-fpm restart # debian-style PHP 7 Using service wrapper script service php-fpm restart # typical service php5-fpm restart # debian-style service php7.0-fpm restart # debian-style PHP 7 Using Upstart (e.g. ubuntu): restart php7.0-fpm # typical (ubuntu … Read more