I get the following error "No input file specified." instead of a file not found when I request a non-existent PHP file.
So is it possible to make Apache check if PHP file exists before passing it to the PHP-FPM server to avoid "No input file specified." error? or that error is normal/harmless?
This is how Apache is configured to handle PHP files:
<FilesMatch \.php$>
SetHandler "proxy:unix:/var/run/php5-fpm.sock.example|fcgi://localhost"
</FilesMatch>
First open the php-fpm configuration file and enable the status page as shown. Inside this file, find and uncomment the variable pm. status_path = /status as shown in the screenshot. Save the changes and exit the file.
By default Apache will use mod_php so now you can configure Apache to use PHP-FPM.
For example, on CentOS 8, with a single version, all PHP configuration files are located in the /etc directory and the default PHP-FPM pool (www) configuration file is /etc/php-fpm. d/www. conf: To list all PHP configuration files, use the following ls command.
PHP-FPM (FastCGI Process Manager) is an alternative to FastCGI implementation of PHP with some additional features useful for sites with high traffic. It is the preferred method of processing PHP pages with NGINX and is faster than traditional CGI based methods such as SUPHP or mod_php for running a PHP script.
I dislike using the RewriteEngine for that task. Here is the correct configuration to use a SetHandler directive, while checking that the PHP file actually exists :
<FilesMatch "\.(php|php[57]|phtml)$">
<If "-f %{REQUEST_FILENAME}">
SetHandler "proxy:fcgi://127.0.0.1:9000"
</If>
</FilesMatch>
Source : PHP-FPM
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With