- Part 1 LAMP
- Part 2 Upgrade PHP to 7.3
- Part 3 Apache Enable Mod Rewrite
- Part 4 Virtual Hosts
- Part 5 Lets Encrypt
- Part 6 MySQL
- Part 7 Remote MySQL
- Part 8 Composer
- Part 9 Laravel
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