Install Laravel 5.8 Nginx Php7.3
Overview
Installing Laravel 5.8 on a Nginx server running PHP 7.3 can be a tricky task. This tutorial explains how to install the popular open source web framework on Nginx and PHP 7.3. Specifically, we will be discussing how to install and configure the Laravel 5.8 software stack on Ubuntu Linux. We will be using Nginx as the web server, PHP 7.3 as the programming language and phpMyAdmin as the database backend.
Laravel is an open source, MVC (model-view-controller) PHP framework. It is widely used for building customized web applications with incredible scalability and security. It is designed to make development easier and faster. With Laravel, application development is made easier by providing simple, expressive syntax for the most common tasks.
Nginx is a popular open-source web server. It is used by many high traffic websites and can handle static and dynamic content with ease. It is also used for load balancing and is an ideal choice for deploying web applications and services.
PHP 7.3 is the latest version of the popular scripting language. It is fast, secure, and lightweight. It offers various new features and improved performance compared to previous versions. It is an ideal choice for building powerful and secure web applications.
Requirements
To install Laravel 5.8 on an Nginx server running PHP 7.3, you will need the following:
- Nginx web server
- PHP 7.3
- MySQL or MariaDB database server
- Composer, the PHP dependency manager
To install Laravel 5.8 on an Nginx server running PHP 7.3, the following steps need to be followed:
Step 1: Install Nginx
Nginx can be installed using the Ubuntu repositories. To install Nginx on Ubuntu, use the following commands:
sudo apt update
sudo apt install nginx
Once the installation is complete, the Nginx service can be started and enabled to start on boot using the following commands:
sudo systemctl start nginx
sudo systemctl enable nginx
To check that Nginx is running correctly, visit http://localhost on a web browser. You should see the default Nginx welcome page.
Step 2: Install PHP 7.3
PHP 7.3 can be installed using the Ubuntu repositories. To install PHP 7.3 on Ubuntu, use the following commands:
sudo apt install php7.3-fpm php7.3-mysql php7.3-common php7.3-mbstring php7.3-xml php7.3-gd php7.3-cli php7.3-zip
Once the installation is complete, the PHP 7.3 FPM service can be started and enabled to start on boot using the following commands:
sudo systemctl start php7.3-fpm
sudo systemctl enable php7.3-fpm
To check that PHP 7.3 is running correctly, use the following command:
php -v
You should see the output of the command as follows:
PHP 7.3.xx (cli) (built: xx xx xx xx)
Copyright (c) 1997-2018 The PHP Group
Step 3: Install MySQL or MariaDB
MySQL or MariaDB can be installed using the Ubuntu repositories. To install MySQL or MariaDB on Ubuntu, use the following commands:
sudo apt-get update
sudo apt-get install mysql-server
Once the installation is complete, the MySQL service can be started and enabled to start on boot using the following commands:
sudo systemctl start mysql
sudo systemctl enable mysql
You can also use the MySQL command line client to check that MySQL is running correctly:
sudo mysql -u root -p
You should see the MySQL shell prompt when the command is executed successfully.
Step 4: Install Composer
Composer is a popular dependency manager for PHP. It can be used to install and manage packages written in PHP. To install Composer on Ubuntu, use the following commands:
curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer
Once the installation is complete, check that Composer is running correctly using the following command:
composer --version
You should see the version of Composer installed.
Step 5: Install Laravel 5.8
Laravel can be installed using Composer. To install Laravel 5.8, use the following command:
composer create-project --prefer-dist laravel/laravel 5.8
This will create a new Laravel 5.8 project in the current directory. To test that Laravel is installed correctly, use the following command:
php artisan --version
You should see the version of Laravel installed.
Step 6: Configure Nginx
Nginx needs to be configured to serve the Laravel application. To do this, edit the default server block in the file `/etc/nginx/sites-enabled/default`, and add the following changes:
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/laravel/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ .php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.3-fpm.sock;
}
}
Save the file and exit. Then, restart the Nginx web server using the following command:
sudo systemctl restart nginx
Conclusion
In this tutorial, we have seen how to install the Laravel 5.8 web framework on an Nginx server running PHP 7.3. We discussed the steps in detail and explained how to configure Nginx to serve our Laravel application. Learning how to install and configure the Laravel framework can help you get started with developing web applications faster. Thanks for reading this article.
FAQs
Q: What is Laravel?
A: Laravel is a popular open source, MVC (model-view-controller) PHP framework. It is designed to make development easier and faster with its simple, expressive syntax for the most common tasks.
Q: What is PHP 7.3?
A: PHP 7.3 is the latest version of the popular scripting language. It is fast, secure, and lightweight. It offers various new features and improved performance compared to previous versions.
Q: What is Composer?
A:
Related Posts:
- Laravel Nginx Default Multiple Site Laravel Nginx Default Multiple Site What is Nginx? Nginx is a popular open source web server used for hosting websites on the internet. It is designed for high-traffic websites and…
- How To Install Php 5 Nginx Centos How To Install Php 5 Nginx Centos What Is PHP 5 Nginx Centos? PHP 5 Nginx Centos is an open source web server software that is optimised to serve dynamic…
- Raspbian Install Nginx And Php7 Raspbian Install Nginx And Php7 Introduction to Nginx and PHP Nginx is a powerful open source webserver and reverse proxy solution. Nginx is lightweight and fast, enabling webmasters to serve…
- Cara Install Nginx Ubuntu 14.04 Cara Install Nginx Ubuntu 14.04 Step 1: Update the Software Packages The first step in installing Nginx is to update the software packages in Ubuntu 14.04. This can be done…
- Linux Nginx Mysql Php Lemp Linux Nginx Mysql Php Lemp What is Linux, Nginx, MySQL, PHP (LEMP)? Linux, Nginx, MySQL, PHP (LEMP) is a software stack combination of Linux, Nginx, MySQL, and PHP, commonly referred…
- Laravel Nginx Without Custom Domain Laravel Nginx Without Custom Domain Overview of Laravel Nginx Without Custom Domain Laravel is an open-source PHP web framework used to create powerful web applications. It is based on the…
- 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…
- Install Php Nginx Mysql Ubuntu 18.04 Install Php Nginx Mysql Ubuntu 18.04 What is PHP, Nginx, and MySQL PHP is a popular and powerful scripting language that can be used to create dynamic web pages, web…
- How To Debian Nginx Php How To Debian Nginx Php Step 1 – Setup Your VPS The first step to setting up your web server is getting your VPS (Virtual Private Server). This is usually…
- Laravel Nginx 502 Bad Gateway Laravel Nginx 502 Bad Gateway What is Nginx 502 Bad Gateway Error? A 502 Bad Gateway error is an HTTP status code that indicates that a server (proxy server, in…
- Upload Max Size Nginx Phpmyadmin Upload Max Size Nginx Phpmyadmin What is Nginx? Nginx is an open source web server and reverse proxy created for high performance and scalability. It is used to serve web…
- Install Nginx And Php On Ubuntu 18.04 Install Nginx And Php On Ubuntu 18.04 Introduction In this article, we will guide you on how to install Nginx and php on Ubuntu 18.04. Nginx is a popular web…
- Hhvm Nginx Ubuntu 16.4 HHVM Nginx Ubuntu 16.4 What is HHVM? HHVM, also known as HipHop Virtual Machine, is a virtual machine developed by Facebook to speed up the execution of PHP code. It…
- Install Nginx And Php On Ubuntu Install Nginx And Php On Ubuntu A Comprehensive Tutorial to Install Nginx And Php On Ubuntu Nginx and PHP are two of the most popular web server and scripting language…
- How To Ubuntu 16.04 Multiple Php Nginx How to Ubuntu 16.04 Multiple PHP Nginx Ubuntu 16.04 is a robust operating system that is commonly used for web application development. This operating system uses Nginx as the web…
- Install Mariadb Nginx Debian 9.7 Install Mariadb and Nginx on Debian 9.7 Overview of Installing MariaDB and Nginx on Debian 9.7 Installing MariaDB and Nginx on Debian 9.7 can be an essential step when setting…
- Install Phpmyadmin On Nginx Centos 7 Install Phpmyadmin On Nginx Centos 7 Introduction PhpMyAdmin is one of the most popular tools used to manage and administer a MySQL database. It is a web-based application and can…
- Install Php Nginx Ubuntu 12.04 Install Php Nginx Ubuntu 12.04 Introduction Welcome to our guide on How to install PHP, Nginx & MySQL on Ubuntu 12.04 LTS. This guide should work on other Linux VPS…
- Nginx Laravel 5.5 500 NGINX Laravel 5.5 500 What is NGINX Laravel? NGINX Laravel is an open source web server and reverse proxy software that is designed to provide robust web hosting services. It…
- Ubuntu Nginx Php-Fpm Short Cut Ubuntu Nginx Php-Fpm Short Cut What Is Nginx? Nginx is a web server software package developed by Igor Sysoev for use with the Linux operating system. It is open source…
- How To Login Phpmyadmin In Nginx Server Ubuntu How To Login Phpmyadmin In Nginx Server Ubuntu What is Nginx & phpMyAdmin Nginx is a web server software that is commonly used on Linux-based systems, though it works on…
- Perfect Server Ubuntu 18.04 Nginx Perfect Server Ubuntu 18.04 Nginx 1. Introduction Ubuntu is one of the most popular Linux distributions. It is popular due to its user friendliness and availability of excellent free software…
- Change Env Laravel Not Affecting In Nginx Server Change Env Laravel Not Affecting In Nginx Server What is Nginx? Nginx is a web server that is developed for high performance and scalability on a host. It can be…
- How To Install Phpmyadmin In Ubuntu 18.04 Nginx How To Install Phpmyadmin In Ubuntu 18.04 Nginx Introduction The MySQL database management system is one of the most popular and powerful open source database systems available today. To make…
- How To Install Cachet Nginx How To Install Cachet Nginx Overview Cachet is an open-source monitoring platform that is widely used by web developers, DevOps engineers, and system administrators for monitoring the performance of a…
- Ubuntu 16 Install Nginx Php Ubuntu 16 Install Nginx Php Step 1 - Installing Nginx and PHP The first step of the process is to install Nginx and PHP. To do this, open the terminal…
- Install Phpmyadmin On Nginx Ubuntu Install Phpmyadmin On Nginx Ubuntu What Is Phpmyadmin? Phpmyadmin is a free, open source web application written in PHP specifically designed to help manage MySQL databases. It is a powerful…
- Laravel Nginx 404 Not Found Laravel Nginx 404 Not Found What is Laravel? Laravel is an open-source, free PHP web framework which is designed for the development of web applications following the model–view–controller architecture. It…
- Emerg Open Etc Nginx Snippets Phpmyadmin.Conf Failed Emerg Open Etc Nginx Snippets Phpmyadmin.Conf Failed What Is Nginx? Nginx is a web server software, similar to Apache, used for serving webpages. It is open source, and is often…
- Install Nginx Phpmyadmin Ubuntu 18.04 Install Nginx Phpmyadmin Ubuntu 18.04 Introduction to Nginx, PHP, and Ubuntu Nginx is an open-source, high-performance web server written in C and used to serve static and dynamic webpages. It…