Even though Ubuntu's own repository has PHP, its better to add a 3rd party repository here because it gets more frequently updated. You can skip that step and stick to Ubuntu's version if that's what you prefer.

Installing Apache

Its time to install Apache server now. We would also need to install libapache2-mod-php5 package to hook up Apache with PHP.

sudo apt-get install apache2 libapache2-mod-php5

Installing Laravel

Before we finally delve into it, we also need Git version control to be installed. If you have it installed, you can skip the following step. If you don't have, then you can follow our guide to set it up first.

To install Laravel, we need to install Composer first. It is a tool for dependency management in PHP that allows you to package all the required libraries associated with a package as one. To install Laravel and all its dependencies, Composer is required. It will download and install everything that is required to run Laravel framework. To install Composer, issue the following commands.

First command downloads composer.phar package to your directory. But we would want composer to run globally hence we need to move it to /usr/local/bin directory under the name 'composer'. Now we can run composer from anywhere.

To install Laravel, move to the public html directory on your system. Since we are on Ubuntu and using Apache, we would install it in /var/www/html directory.

Now we have to enable this newly created .conf file and disable the default .conf file that is installed with the default Apache install. Also we need to enable mod_rewrite so that permalinks can function properly.

Hi! I have tried to install the laravel..but when I type this command "sudo composer create-project laravel/laravel your-project --prefer-dist" I get the following error: [Composer\Downloader\TransportException] The "https://packagist.org/packages.json" file could not be downloaded: fai led to open stream: Connection timed out ......Somebody help...I will so much appreciate thanks