You define your root as a relative path, which is relative to the nginx
configuration directory.
This is then passed to php-cgi
, which probably does not care where nginx
keeps its files. So cannot resolve ../../
.
You should specify an absolute root.
manpreet
Best Answer
2 years ago
I'm running php-cgi and NGINX. They are running in a folder, however their root directory is 2 directories out, and 2 in from there. When the root was html (default), they worked perfectly, however now php reports the "No Input File Specified" error. I've tried setting the directory to give full control to all programs, I already have full control, I've tried to see if php is looking in a different directory, tried changing the directories, hard coding the php variable, etc. I've followed about 5 different tutorials on how to fix this problem, but none have resolved it. There are no errors in the console and my fastcgi.conf is unchanged. php and NGINX are both definitely running and communicating, however php fails to get the file for some reason. When accessing any non-php file, NGINX successfully retrieves the file and my browser displays it. I have verified, using netstat, that the only thing listening on port 9100 is my php-cgi. And the only thing listening on port 8080 is NGINX. Both php and NGINX are configured to communicate correctly, and php-cgi is running via RunHiddenConsole.exe which is in the php directory.
Here is the directory tree, in a format similar to YAML:
And my nginx.conf
What could be the cause of this error and how can I resolve it so that I can view the php files properly in my browser? (I am using Eclipse PHP to edit the source, and the error occurs with and without Eclipse running.)