Currently seeking new career opportunities in web development, particularly with Laravel, Hire Me

Setup Digital Ocean - Part 9 Laravel

David Carr

VPS Tutorials Digital Ocean


The following steps are needed for running Laravel on Digital Ocean.

Laravel needs mbstring it’s not installed, don’t edit php.ini that causes more problems instead:

sudo apt install php-mbstring

Then activate it:

sudo phpenmod mbstring

To turn off modules you can use phpdismod 

Next install zip and dom

sudo apt install php-zip
sudo apt install php7.3-xml

Restart Apache2

systemctl restart apache2

Installing Laravel

composer create-project --prefer-dist laravel/laravel foldername

If you get the error:
proc_open(): fork failed - Cannot allocate memory_

A swap file is needed run this on the root:

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

cd into the laravel folder and change permissions by running:

sudo chgrp -R www-data storage bootstrap/cache
sudo chmod -R ug+rwx storage bootstrap/cache
Laravel Modules Your Logo Your Logo Your Logo

Become a sponsor

Help support the blog so that I can continue creating new content!

Sponsor

My Latest Book

Modular Laravel Book - Laravel: The Modular way

Learn how to build modular applications with Laravel Find out more

Subscribe to my newsletter

Subscribe and get my books and product announcements.

Learn Laravel with Laracasts

Faster Laravel Hosting

© 2006 - 2024 DC Blog. All code MIT license. All rights reserved.