Tag Archives: FastCGI sent in stderr: “Primary script unknown” while reading response head…

Nginx+PHP FastCGI sent in stderr: “Primary script unknown” while reading response head…

When deploying ZABBIX’s LNMP environment, the test PHP page can’t be opened. Check the error log of nginx and report an error fastcgi send in stderr: “primary script unknown” while reading response header from upstream

1. Online query has modified nginx. Conf, as follows

fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
to
fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;

Then execute service nginx reload or service nginx restart or enter/etc/init.d/nginx restart

The author is to modify the above configuration to solve the problem

2. Some say that user and group in PHP FPM do not specify nginx as their user( My configuration has been specified in advance, so rule out this reason. Students without configuration can try.)

edit php-fpm
vi /usr/local/php/etc/php-fpm.conf

line 149