Question

How to install Laravel 7 and composer in a server that has already installed WordPress on Ubuntu 18.04

Dear, friends.

My server is using WordPress on Ubuntu 18.04 with PHP 7.4 ([https://www.digitalocean.com/products/marketplace/])

The WordPress is already installed and runs smoothly, and now i want to learn creating feature on my site using Laravel latest version.

My WordPress is installed in var/www/html folder, and i want to create the Laravel project in var/www/html/my-laravel-project

Please help guide me by recommend tutorial links, so i can learn it step by step, without breaking the WordPress and other related configuration.

Thank you.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there @Technosatmedia,

First, I would strongly recommend enabling backups for your Droplet or creating a snapshot. That way if anything goes wrong, you could revert back to a working version.

Then you will need to install composer, you could do that by following the steps here:

https://www.digitalocean.com/community/tutorials/how-to-install-and-use-composer-on-ubuntu-18-04

Once you have composer installed you can install Laravel with the following commands:

  • First go to your /var/www/html folder:
cd /var/www/html
  • Then install Laravel:
composer create-project --prefer-dist laravel/laravel my-laravel-project

After that Laravel will be available at /var/www/html/my-laravel-project.

After that, you can follow Step 4 from this tutorial here on how to configure Laravel:

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-laravel-with-lemp-on-ubuntu-18-04#step-4-—-configuring-laravel

Regards, Bobby