Lets install some prerequisites:
Install apache and check the status if it’s running properly:
You can check if you have installed apache properly by opening this address in your browser, which would open a default apache2 page:
http://localhost
Now enable the mod_rewrite in apache2:
Run the following command to install MySQL:
Then run this is secure your mysql installation:
Now answer the questions:
Remove anonymous users? y
Disallow root login remotely? y
Remove test database and access to it? y
Reload privilege tables now? y
Install PHP:
Now check if the PHP is installed properly by creating a new file:
Put the following content in the above file:
You can open the following URL in your browser to see all the configured PHP settings:
http://localhost/info.php
Now delete the info.php as it is not needed anymore and could cause a potential security issue as this exposes a lot of details.
Install the PHP depedency manager known as Composer:
Now go to the directory where you would like to install Laravel and then run the following:
Now you can start the inbuilt server:
You can verify it here:
http://127.0.0.1:8000
That’s it! You have successfully installed Laravel on your Ubuntu machine. 🎉