"error writing /usr/share/nginx/www/info.php: No such file or directory" when trying to save and exit

January 16, 2015 2.7k views

Hi all,

New to this stuff and being really overwhelmed. I'm at step 7 in this tutorial and getting the error above.

I just created the file in the previous step so why is it giving me this error?

Thanks

2 comments
  • Are you doing this on Ubuntu 12.04 or on 14.04. That tutorial includes this note:

    UPDATE: Newer Ubuntu versions create a directory called 'html' instead of 'www' by default. If /usr/share/nginx/www does not exist, it's probably called html. Make sure you update your configuration appropriately.
    

    This would likely explain the error you are encountering if the www directory does not exist. You will need to ensure you update that path you are using to html instead.

  • Is this the tutorial you are trying to follow:
    https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-on-debian-7

    Please provide a link to the tutorial you are following, and this line of information you get when you click on your droplet information in your Digital Ocean control panel...
    Active 512MB Ram 20GB SSD Disk New York 3 Ubuntu LAMP on 14.04

    by Adam LaGreca
    LEMP stack is a group of open source software to get a VPS up and running. The acronym includes the Linux (L), MySQL (M), and PHP (P) of the more traditional LAMP stack, but switches out Apache for Nginx (pronounced engine x). This tutorial explains how to install nginx/MySQL/PHP-fpm, as well as all the required repos to download nginx and php-fp. It will also review how to configure php & nginx, as well as how to create a php info page. *Written for Debian 7.
1 Answer

This question was answered by @ryanpq:

Are you doing this on Ubuntu 12.04 or on 14.04. That tutorial includes this note:

UPDATE: Newer Ubuntu versions create a directory called 'html' instead of 'www' by default. If /usr/share/nginx/www does not exist, it's probably called html. Make sure you update your configuration appropriately.

This would likely explain the error you are encountering if the www directory does not exist. You will need to ensure you update that path you are using to html instead.

View the original comment

Have another answer? Share your knowledge.