Unable to open primary script. cannot move it from etc/nginx/html.

June 7, 2015 2.7k views
Nginx PHP CentOS

Hi, i've followed this guide:

i believe i've followed it correctly. i had it working (step 5 worked), then i wanted to change the default directory (for the websites) to /usr/home/Solder. but when i try to access info.php which is in that directory (as a test) i get no input file specified. i check the error logs for nginx and it shows:

FastCGI sent in stderr: "Unable to open primary script: /etc/nginx/html/info.php (No such file or directory)"

i did have to change Doc_Root in php.ini to the location for step 5 to work, i have changed that to usr/home/Solder now.
its changed to that directory and i dont know why. it wouldnt be file permissions, because it's showing an entirely different path

i am quite fresh with Linux, so forgive me if its an easy fix

2 Answers

Post your config file, e.g. /etc/nginx/sites-available/default if you use this. Then it is possible to see what you did wrong.

I believe you did that wrong (in config file e.g. /etc/nginx/sites-available/default) :

Change root:

root /usr/home/Solder

To create a new info.php do this:

touch /usr/home/Solder/info.php
nano /usr/home/Solder/info.php

Paste this (right click):


Restart your Server service nginx restart

Have another answer? Share your knowledge.