Requirements for Installing Laravel 5.4 on Ubuntu 17
This article will guide you through the process of installing Laravel 5.4 on Ubuntu 17. Before we move on to the installation process, there are a few things that we need to make sure we have in place. First of all, you should have a fresh install of Ubuntu 17. Secondly, it is important to have Nginx installed already. Third, you will need Node.js installed (this can be done by following this article: Install Node.js on Ubuntu 17.04). Last but not least, you need to ensure that you have MySQL installed (this can be done by following this article: Install MySQL on Ubuntu 17.04).
Installing Composer
We need to install Composer in order to install Laravel 5.4. To do this, first enter the command: sudo apt-get install composer. Once the installation has finished, you can verify that it is installed properly by entering the command : composer -V. The output should display the version of Composer which is installed.
Installing Laravel 5.4 on Ubuntu 17
In order to install Laravel 5.4 on Ubuntu 17, we need to first download and install it. To do this, we must first enter the command : composer create-project laravel/laravel myproject --prefer-dist. This command will install the latest version of Laravel 5.4. Once the installation is complete, navigate to the newly created project directory. You can do this by entering the command : cd myproject.
Configuring Nginx for Laravel 5.4
Now that Laravel 5.4 is installed, we need to configure Nginx for it. To do this, create a new Nginx virtual host configuration file. You can do this by entering the command : sudo nano /etc/nginx/sites-available/myproject.conf. Once the file is created, paste the following inside of it:
server {
listen 80;
root /var/www/myproject/public;
index index.php index.html index.htm;
server_name myproject.com;
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
location ~ /.ht {
deny all;
}
}
Once you have pasted the above code, save the file and close it. To enable the Nginx virtual host configuration, enter the command : sudo ln -s /etc/nginx/sites-available/myproject.conf /etc/nginx/sites-enabled/. Lastly, we need to restart Nginx so that the changes can take effect. You can do this by entering the command : sudo systemctl restart nginx.
Configuring MySQL for Laravel 5.4
Before configuring MySQL for Laravel 5.4, lets create a new database. To do this, log in to MySQL by entering the command: mysql -u root -p [enter_your_MySQL_password]. Once you are logged in, create a new database by entering the following command : CREATE DATABASE myproject;. Next, we need to create a new user for this database. To do this, enter the command : CREATE USER 'myproject'@'localhost' IDENTIFIED BY '[enter_your_password]';. Finally, we need to grant privileges to our newly created user. You can do this by entering the following command: GRANT ALL PRIVILEGES ON myproject.* TO 'myproject'@'localhost';. Once you have done this, exit the MySQL shell by entering the command : exit.
Connect Laravel 5.4 with MySQL
Now, let us connect our newly created database with Laravel 5.4. To do this, open the .env file inside of our project directory. This can be done by entering the command : nano .env. Once the file is open, search for the following code :
Once you have done this, save and close the file. Your project is now connected to MySQL.
Testing Laravel 5.4 Installation
Now that everything is set up, let us test our Laravel 5.4 installation. To do this, open the browser and enter the URL : http://localhost/myproject/public. If everything is set up correctly, you should see the Laravel welcome page as shown below.
Conclusion
That’s it! You have now successfully installed Laravel 5.4 on Ubuntu 17. This article only covered the basics of getting started with Laravel 5.4. There are many more features and settings that can be adjusted, but this should give you the basic foundation to start building your applications. Thank you for reading this article. Please read other articles for further help.
Related Posts:
Tutorial Install Nginx Di Ubuntu Vps Tutorial Install Nginx Di Ubuntu Vps Step 1: Install Nginx The first step to install nginx in your Ubuntu VPS is to install the nginx package. To do this, use…
Error Install Nginx On Ubuntu Error Install Nginx On Ubuntu What is Nginx? Nginx is a web server software used to host web applications. It is open source software developed by the open source community.…
Install Webmin Plugin Nginx Ubuntu Install Webmin Plugin Nginx Ubuntu What is Nginx? Nginx is a web server that runs on the Linux operating system. It is a popular web server software and can handle…
How To Install Http 3 Nginx How To Install Http 3 Nginx Prerequisites Before Installation When installing the HTTP 3 Nginx server, there are some prerequisites that need to be addressed first. Most notably, you will…
Install Phpmyadmin On Nginx Ubuntu 18.04 Install Phpmyadmin On Nginx Ubuntu 18.04 Introduction PhpMyAdmin is one of the most popular and widely used web-based database management tools available. It is used for administering, managing and maintaining…
Nginx Install Ssl Certificate Ubuntu Nginx Install SSL Certificate Ubuntu What is Nginx? Nginx is a free, open-source web server that is used for powering websites. It is popular for its speed, scalability, and stability,…
Instal Nginx 1.5.0 Installing Nginx 1.5.0 Overview of Nginx Nginx is a web server that is used to serve web content quickly and reliably. It is popularly used in asynchronous web applications, due…
Docker Compose Nginx Node Js Mysql Docker Compose Nginx Node Js Mysql What is Docker Compose? Docker Compose is a utility used to deploy and manage applications created with multiple services (or containers) in a single…
Install Laravel Nginx 16.04 Install Laravel Nginx 16.04 What is Laravel? Laravel is an open source PHP framework designed to organize, develop, and easily deploy modern web applications. It is built on the Model-View-Controller…
Reverse Proxy Nginx Ubuntu 18.04 Reverse Proxy Nginx Ubuntu 18.04 Introduction Reverse Proxy is a type of proxy server that forwards requests to another server. It is mainly used by web servers, such as Nginx,…
Ubuntu Server18 How To Enable Nginx Pdo Mysql Ubuntu Server18: How to Enable Nginx Pdo Mysql As a developer, you may have heard of Nginx, PDO, and MySQL – all are essential components of web applications. Nginx is…
Nginx Php Fpm 7.2 Nginx Php Fpm 7.2 Introduction to Nginx and PHP-FPM Nginx is an open-source web server, reverse proxy server, and load balancer. It is known for being lightweight and fast, and…
Laravel 5.5 Configure Nginx Laravel 5.5 Configure Nginx Introduction To Nginx Nginx is a web server software often deployed as a reverse proxy. It is open-source and available to download for free. Nginx has…
Config Node Js And Nginx Config Node Js And Nginx Introduction Node.js is a popular server-side language for building web applications and services, and Nginx is a popular web server used for serving static web…
How To Set Up Nginx Loadbalancer Ubuntu How To Set Up Nginx Loadbalancer Ubuntu Introduction to Nginx Loadbalancer Nginx Loadbalancer is a web application that lets you easily set up load balancing for your website. It is…
Nginx Ssl Configuration Ubuntu 18.04 Nginx Ssl Configuration Ubuntu 18.04 What is Nginx? Nginx is an open source web server and reverse proxy software. It is used to manage web traffic on the internet, like…
Ubuntu Install Web Server Nginx Ubuntu Install Web Server Nginx Step 1: Install the Nginx Package The first step when installing Nginx on Ubuntu is to install the Nginx package from the Ubuntu repository. This…
Ubuntu Nginx Check Php Status Ubuntu Nginx Check Php Status Introduction Nginx is a widely used web server, created by Igor Sysoev back in 2004, intended to be faster and more efficient than previously available…
Digital Ocean Ubuntu Nginx Docker Digital Ocean Ubuntu Nginx Docker What is Digital Ocean? Digital Ocean is a cloud computing provider. It is a great platform for businesses and developers who need to quickly set…
Install Nginx Ubuntu 18.08 Local Install Nginx on Ubuntu 18.04 Local Installing Nginx on Ubuntu 18.04 can be accomplished quickly and in several different ways. Depending on your needs, some methods may be better suited…
Access To The Path Is Denied Nginx Ubuntu Access To The Path Is Denied Nginx Ubuntu What is the Problem? Access to the path is denied Nginx Ubuntu is an issue that can occur when running software that…
Install Paid Ssl Nginx Ubuntu 18.04 Install Paid SSL Nginx Ubuntu 18.04 What Is Nginx? Nginx is an open-source web server and reverse proxy used in many applications worldwide. It is a lightweight, high-performance server that…
Install Wordpress On Ubuntu 18.04 Nginx Install WordPress On Ubuntu 18.04 Nginx Introduction To Ubuntu And Nginx Ubuntu is a popular open-source operating system which has gained immense popularity over the years. It is easy to…
Ubuntu Server Postgresql Nginx Php Ubuntu Server Postgresql Nginx Php Introduction Optimizing your server is one of the most important steps you can take when it comes to running a successful website or application. It…
Laravel Nginx Not Custom Domain Laravel Nginx Not Custom Domain Overview of Laravel, Nginx, and Custom Domains Laravel is an open-source model-view-controller web application development framework written in PHP. It is the most popular framework…
Virtualhost Nginx Ubuntu 16.04 Virtualhost Nginx Ubuntu 16.04 Introduction to Virtualhost Virtualhost is a software configuration option in web servers including Apache, Nginx, and more that allows a web server to host multiple web…
Install Laravel Nginx Ubuntu 18.04 Install Laravel Nginx on Ubuntu 18.04 Introduction In this tutorial, we will look at how to install Laravel with Nginx on an Ubuntu 18.04 server. Laravel is a powerful PHP…
Lets Encrypt Nginx Ubuntu 14.04 With Nginx Conf Custom Let's Encrypt Nginx Ubuntu 14.04 with Nginx Conf Custom Introduction to Nginx Conf Custom Nginx Conf Custom is an open source solution for hosting web applications on Ubuntu 14.04. It…
Nginx Server Install In Windows Nginx Server Install In Windows Introduction Nginx is a powerful web server software meant for setting up web servers on the internet. It is capable of serving static and dynamic…
Install Nginx Php5.6 Mysql Centos 7 Install Nginx Php5.6 Mysql Centos 7 Requirements Before we get started, let us go through the system requirements to install Nginx, Php5.6 and MySQL on CentOS 7. CentOS 7 Root…