Question

CentOS - nginx - no input file specified

  • Posted December 14, 2013

I followed this tutorial (https://www.digitalocean.com/community/articles/how-to-install-linux-nginx-mysql-php-lemp-stack-on-centos-6) and everything worked perfectly.

However when I want to change my site’s root, I get the message ‘no input file specified’.

Compared to the tutorial I change 2 lines: location / { root /home/username/www/laravel/public; … } And location ~ .php$ { root /home/username/www/laravel/public; … }

I want my root to be there because I want to be able to access my webapp with ftp.

Any ideas what’s going wrong? Should be something small I guess?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

thanks for reply @kamaln7
issue was in php-fpm and nginx configuration file. root path was not specified where my all php files was stored…

any one got answer for this because i m also in a same issue “no input file specified”

Ok awesome I fixed it. The problem was indeed permission related and this post helped me fix it: http://stackoverflow.com/questions/6795350/nginx-403-forbidden-for-all-files <br> <br>The directory /home/webstudions had the wrong permissions. <br>chmod -R 755 /home/webstudions <br>solved the problem. <br> <br>Thanks a lot for your help!

The command has the following output: <br>drwxr-xr-x 2 webstudions webstudions 4096 Dec 14 15:13 public <br>It would make sense that it is a permission problem because going to appstudions.be gives a 403 while there is a index.php in the public directory now. <br>appstudions.be/info.php still gives “no input file specified.”

<b>“Unable to open primary script…”</b> <br> <br>Might be a permissions problem. What’s the output of <br><pre>ls -l /home/webstudions/www/laravel/</pre> <br>make sure the <code>public</code> directory is web visible.

Changing my server_name wasn’t necessary for the tutorial to work and changing it now doesn’t make a difference either. <br>It just changes the error message to this: <br>9634#0: *6 FastCGI sent in stderr: “Unable to open primary script: /home/webstudions/www/laravel/public/info.php (No such file or directory)” while reading response header from upstream, client: 78.104.133.128, server: www.appstudions.be, request: “GET /info.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “www.appstudions.be” <br> <br>In the folder was no index.php, only info.php. Adding it doesn’t solve the problem. <br> <br>I know FTP is not secure. I setup sftp using this tutorial: https://www.digitalocean.com/community/articles/how-to-configure-vsftpd-to-use-ssl-tls-on-a-centos-vps and that’s working correctly!

stat /home/webstudions/www/laravel/public/info.php <br>Gives the following output: <br>File: `/home/webstudions/www/laravel/public/info.php’ <br> Size: 22 Blocks: 8 IO Block: 4096 regular file <br>Device: fd00h/64768d Inode: 262167 Links: 1 <br>Access: (0664/-rw-rw-r–) Uid: ( 500/webstudions) Gid: ( 500/webstudions) <br>Access: 2013-12-14 13:14:21.683000223 +0000 <br>Modify: 2013-12-14 13:14:21.683000223 +0000 <br>Change: 2013-12-14 14:14:43.779999877 +0000

Your <code>server_name</code> directive looks problematic. Change it to your domain name or your server’s IP address. Also, do you have one of these files <code>index index.php index.html index.htm</code> in the <code>/home/webstudions/www/laravel/public</code> directory? <br> <br><b>“… I want to be able to access my webapp with ftp.”</b> <br> <br>FTP is very insecure. SFTP is easier to use (b/c you do not have to install & configure and FTP server) and is much more secure. <i>See</i> <a href=“https://www.digitalocean.com/community/articles/how-to-use-filezilla-to-transfer-and-manage-files-securely-on-your-vps”>How To Use Filezilla to Transfer and Manage Files Securely on your VPS</a> or <a href=“https://www.digitalocean.com/community/articles/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server”>How To Use SFTP to Securely Transfer Files with a Remote Server</a>.

Hmm. What’s the output of <pre>stat /home/webstudions/www/laravel/public/info.php</pre>?

Ok I have a couple of lines like this one: <br>[error] 9594#0: *9 FastCGI sent in stderr: “Unable to open primary script: /home/webstudions/www/laravel/public/info.php (No such file or directory)” while reading response header from upstream, client: 78.104.133.128, server: _, request: “GET /info.php HTTP/1.1”, upstream: “fastcgi://127.0.0.1:9000”, host: “www.appstudions.be” <br> <br>but doing: <br>$ cd /home/webstudions/www/laravel/public/ <br>$ ls <br>gives: <br>info.php <br> <br>my nginx config: http://pastebin.com/amnzFgUk <br>