Updated: 2019-02-24
Laravel utilizes Composer to manage its dependencies. Download and install Composer.
Download ComposerInstall Composer globally.
Install Composer globally instructionsTest Composer.
composer --version
Install zip and unzip.
sudo apt-get install zip unzip
Download the Laravel installer.
composer global require laravel/installer
Add composer's system-wide vendor bin directory to your $PATH.
echo 'export PATH="~/.config/composer/vendor/bin:$PATH"' >> ~/.bashrc
I want to put my website files in /var/www/html which is currently owned by root, so I'm gonna change the owner to my user and then change it back. Go to the www directory.
sudo chown user
html
Go into the html directory and create new Laravel project.
laravel new project_name
Go back to the www directory and change html dir owner back to root.
sudo chown root html
Go to your projects directory /var/www/html/your_project
Change the storage and /bootstrap/cache directories group to www-data.
sudo chgrp -R www-data storage bootstrap/cache
Change the storage and /bootstrap/cache directories permissions .
sudo chmod -R ug+rwx storage bootstrap/cache
Set Application Key.
php artisan key:generate
Create cache table.
php artisan cache:table
Migration created successfully!
php artisan migrate
Migrating: 2019_02_24_153528_create_cache_table
Migrated: 2019_02_24_153528_create_cache_table
dd(extension_loaded('memcached'));
Publish laravel error pages.
php artisan vendor:publish --tag=laravel-errors
For a more detailed explanation: Check out these tutorials.
Laravel Docs Composer Deploy Laravel Application with Nginx on Ubuntu