How to Fix FastCGI “Unable to open primary script” Error

Website FastCGI sent in stderr: "Unable to open primary script", browser returns a 404 error when accessing PHP pages.

Cause: php-fpm permission issue (using my php-fpm setup as an example)

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

service php-fpm restart # Restart; using my startup method as an example

Change the user to match the one in the nginx.conf file.

Leave a Comment

Your email address will not be published.