Installing Laravel 5.1 with Nginx Error500

December 5, 2015 3.3k views
PHP Frameworks Nginx Ubuntu

Good evening guys,
I followed this tutorial however in the end It appears this:

root@xxxxx:~# sudo chmod -R 775 /var/www/laravel/app/storage
chmod: cannot access '/var/www/laravel/app/storage': No such file or directory

And when I insert the ip droplet in the browser shows a 500 Error.

Someone knows how to fix this?

1 Answer

You probably missed these steps, try these first and then try again:

Install Composer and Laravel
Now, we are finally ready to install Composer and Laravel. We will set up Composer first. We will then use this tool to handle the Laravel installation.

Move to a directory where you have write access (like your home directory) and then download and run the installer script from the Composer project:

cd ~
curl -sS | php

This will create a file called composer.phar in your home directory. This is a PHP archive, and it can be run from the command line.

We want to install it in a globally accessible location though. Also, we want to change the name to composer (without the file extension). We can do this in one step by typing:

sudo mv composer.phar /usr/local/bin/composer

Now that you have Composer installed, we can use it to install Laravel.

Remember, we want to install Laravel into the /var/www/laravel directory. To install the latest version of Laravel, you can type:

sudo composer create-project laravel/laravel /var/www/laravel

Now, the files are all installed within our /var/www/laravel directory, but they are entirely owned by our root account. The web user needs partial ownership and permissions in order to correctly serve the content.

We can give group ownership of our Laravel directory structure to the web group by typing:

sudo chown -R :www-data /var/www/laravel
Have another answer? Share your knowledge.