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 Migration From Apche To Nginx Laravel Migration From Apache To Nginx What is Nginx? Nginx is a web server that has become increasingly popular over the years. It is robust, reliable, and secure. Nginx is…
- 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 Php Java On Centos 7 Install Nginx Php Java On Centos 7 What is Nginx? Nginx is an open source Web server created to serve Web traffic efficiently, reliably, and quickly. Nginx has become the…
- Cara Install Nginx Debian 4.9 Cara Install Nginx Debian 4.9 Introduction Debian 4.9 is a major release of the Debian Linux-based operating system. It is the first major version of the operating system to be…
- How To Set Static Nginx How To Set Static Nginx Understanding What is Nginx? Nginx is an open source Web server software used for hosting static or dynamic websites, media streaming, and other web applications.…
- 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…
- 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…
- How To Install Nginx On Ubuntu 18.04 How To Install Nginx on Ubuntu 18.04 Introduction Nginx is a popular open-source web server and reverse proxy software that’s used by millions of websites. It’s the most widely used…
- 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 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…
- 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…
- Laravel 5.7 Css Not Loading Nginx Laravel 5.7 Css Not Loading Nginx Introduction When building your web application with Laravel 5.7 and using the Nginx web server, you may experience issues when serving CSS files with…
- Install Pdo_Mysql Ubuntu Nginx Install Pdo_Mysql Ubuntu Nginx What is Pdo_Mysql? PDO_Mysql is a driver for the PHP Data Objects (PDO) extension that provides a database abstraction layer for working with MySQL databases.PDO_Mysql provides…
- Install Postgis Ubuntu 18.04 Nginx Install Postgis Ubuntu 18.04 Nginx What is Postgis? Postgis is a Postgres-based open source geographic information system (GIS) that enables users to store, query, and analyze spatial data stored in…
- 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…
- Move On Nginx Web Root To A New Location Laravel Move On Nginx Web Root To A New Location Laravel Introduction Nginx is a web server and reverse proxy for sites running on the web. It’s fast and efficient, and…
- Setting Phpmyadmin Di Nginx Debian 9 Setting Phpmyadmin Di Nginx Debian 9 Introduction Nginx is a popular web server created for Unix-like operating systems like Debian. It is used for many web-related activities such as serving…
- Install Nginx And Php Scract In Docker Install Nginx And PHP Script in Docker What is Docker? Docker is a popular platform for creating, running, and managing applications in a lightweight container system. Originally released as an…
- 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…
- 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,…
- 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…
- How To Install Flask Nginx On Ubuntu 1604 How To Install Flask Nginx On Ubuntu 1604 Introduction Flask is a web application framework based on Python. It is highly useful for web developers due to its flexibility and…
- Install Nginx Ubuntu 16.04 For Odoo Install Nginx Ubuntu 16.04 For Odoo Install Ubuntu Server 16.04 Before we can install Nginx for Odoo we need to install Ubuntu 16.04 on our server. Ubunutu 16.04 is still…
- Add Php7.2 Curl To Nginx Add Php7.2 Curl To Nginx Overview In this article, we’ll discuss how to add Php7.2 with Curl module to Nginx. Since Php7.2 is the latest version of the PHP language,…
- 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…
- 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…
- 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…
- Install Phpmyadmin Nginx Ubuntu 16.04 Install Phpmyadmin Nginx Ubuntu 16.04 What is PhpMyAdmin? PhpMyAdmin is an open-source software for managing MySQL databases. It can be used to add, modify, and delete databases, tables, and columns.…
- Setting Proxy Nginx Centos 7 Setting Proxy Nginx Centos 7 Introduction Setting up a proxy server on a CentOS 7 server is a relatively straightforward task. Nginx is a powerful open source reverse proxy server…
- 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…