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:
- Directory Index Of Is Forbidden Nginx Laravel Directory Index of is Forbidden Nginx Laravel What is Directory Index Of? Directory Index Of is an Nginx configuration setting which dictates whether or not a directory can be accessed…
- Nginx Php-Fpm Php Stack Overflow Articel Nginx Php-Fpm Php Stack Overflow Articel What Is Nginx? Nginx (pronounced engine-x) is an open source web server and reverse proxy software that is popular for its high performance and…
- 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…
- Install Php5 Nginx Ubuntu 18.04 Install PHP5 Nginx Ubuntu 18.04 Understanding The Basics of Nginx and PHP Before we learn how to install Nginx and PHP on Ubuntu 18.04, it’s important to understand the basic…
- Step By Step Install Nginx And Phpmyadmin On Ubuntu Step By Step Install Nginx And Phpmyadmin On Ubuntu Introduction Setting up a web server on Ubuntu is easy and straightforward. Nginx is a popular web server for Ubuntu, and…
- Install Php 7 In Nginx Centos 7 Install Php 7 In Nginx Centos 7 1. Overview & Background We will start from having a quick overview and understanding the background of the installation of PHP 7 in…
- 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…
- Setting Up Php7 With Nginx Setting up PHP7 With Nginx What is PHP7? PHP7 is the most recent major release of PHP, a server-side scripting language used for dynamic web pages. PHP7 provides accelerated performance,…
- 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 Php Mysql Phpmyadmin Centos 7 Install Nginx Php Mysql Phpmyadmin Centos 7 A Brief Overview of Centos 7 Centos 7 is a Linux distribution based on the Redhat Enterprise Linux Server, and is a popular…
- Cloudhost Deploy Laravel 5.4 To Vps Centos7 Nginx Cloudhost Deploy Laravel 5.4 To Vps Centos7 Nginx Introduction to Deploy Laravel 5.4 to VPS CentOS7 Nginx Laravel is a free open-source framework for web applications. It provides modern and…
- Install Phpmyadmin For Nginx Debian 8 Install Phpmyadmin For Nginx Debian 8 Introduction The Nginx web server popularly known as Nginx is a lightweight web server written in C programming language. It is an open source…
- Docker Install Nginx Mysql Php Docker Install Nginx Mysql Php What is Docker? Docker is an open-source platform for automating the deployment of applications as lightweight, portable, and self-sufficient containers. It bundles applications and all…
- Nginx Reverse Proxy Subdirectory Laravel Nginx Reverse Proxy Subdirectory Laravel What is Nginx? Nginx is a popular open-source web server used for running web applications. It is fast and can handle large amounts of traffic.…
- Install Nginx Phpmyadmin Centos 7 Install Nginx Phpmyadmin Centos 7 What is Nginx? Nginx is a web server that is used in Linux-based operating systems such as Centos 7. It is designed to handle high-traffic…
- Debian Install Nginx Php Mysql Phpmyadmin On Debian 9 Debian Install Nginx Php Mysql PhpMyAdmin On Debian 9 What Is Debian 9? Debian 9 (codenamed “stretch”) is the most recent stable version released by the Debian project, the developers…
- Ubuntu 18.04 Nginx Php Mariadb Ubuntu 18.04 Nginx, Php, and Mariadb Understanding Ubuntu 18.04 Ubuntu 18.04 is the latest version of the popular open-source Linux distribution. It is based on Debian and is known for…
- Completely Uninstall Phpmyadmin On Nginx Ubuntu 18.04 Completely Uninstall PhpMyAdmin On NGINX Ubuntu 18.04 Introduction PhpMyAdmin is a very popular web-based graphical tool for managing MySQL databases in the Ubuntu operating system. It is used by web…
- Laravel Nginx Config Ubuntu 18 Laravel Nginx Config Ubuntu 18 Introduction Laravel is a powerful web-based MVC (Model-View-Controller) framework used by developers to create web applications, websites and APIs. It is based on the popular…
- Php-Fpm Nginx Ubuntu 18.04 PHP-FPM & Nginx on Ubuntu 18.04 Introduction to PHP-FPM PHP-FPM (FastCGI Process Manager) is an implementation of FastCGI, which is a standard protocol for interfacing external applications with web servers.…
- Install Nginx Php Mysql Ssl & Wordpress On Ubuntu 18.04 Install Nginx Php Mysql Ssl & Wordpress On Ubuntu 18.04 What is Nginx, Php, Mysql, SSL and Wordpress? Nginx is a high-performance web server that is widely used to serve…
- 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…
- How To Install Phpmyadmin On Nginx How To Install Phpmyadmin On Nginx Introduction PhpMyAdmin is an open source software program which is used to manage MySQL and MariaDB databases. It provides a graphical interface to execute…
- Deploy Laravel In Local Nginx Windows Deploy Laravel In Local Nginx Windows 1. Introduction To Nginx Nginx is a web server that is primarily used to handle web traffic. It is open source, meaning it is…
- Laravel In Local Nginx Windows Laravel In Local Nginx Windows Introduction Laravel is an open-source PHP framework that allows you to quickly create robust web applications. A large part of the development process for any…
- How Use Nginx Mysql Ubuntu How to Use Nginx, MySQL and Ubuntu What is Nginx? Nginx is an open source web server and reverse proxy software written by Igor Sysoev. It is a popular choice…
- Install Nginx Php Mysql Phpmyadmin Ubuntu 18.04 Install Nginx Php Mysql Phpmyadmin Ubuntu 18.04 Introduction In this article, we will demonstrate how to install Nginx, PHP, MySQL, and phpMyAdmin on an Ubuntu 18.04 server. Nginx is a…
- 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…
- Nginx Php Fpm 7.2 Laravel Nginx Php Fpm 7.2 Laravel Introduction to Nginx Nginx (pronounced “engine-x”) is a free, open-source web server software. It’s quickly becoming one of the most popular web servers, used by…
- 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…