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:
- 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…
- 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 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…
- 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…
- Nginx Wordpress Ubuntu 18.04 Nginx Wordpress Ubuntu 18.04 Introduction to Nginx Nginx is a web server software for hosting websites and applications. It is open-source and highly configurable, making it a popular choice for…
- 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…
- Remove Apache2 Ubuntu And Change To Nginx Remove Apache2 Ubuntu And Change To Nginx What Is Apache2? Apache2 is an open-source web server software created and maintained by the Apache Software Foundation. It is one of the…
- 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…
- 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…
- 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 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 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.…
- 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…
- 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…
- 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…
- Slim Framework Nginx Alias Php Slim Framework Nginx Alias Php What is Slim Framework? The Slim Framework is a micro web application framework written in PHP to quickly and easily create web applications and APIs.…
- 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…
- 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…
- 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…
- 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…
- 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…
- 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…
- 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…
- Cannot Accept Header Api Lumen Nginx Cannot Accept Header Api Lumen Nginx What is Lumen and What Does it Do? Lumen is a lightweight micro-framework provided by Laravel, developed to provide a high speed and flexible…
- 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…
- 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,…
- 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…
- 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 Rails On Ubuntu Nginx Rbenv Install Rails On Ubuntu Nginx Rbenv Introduction Rails is an open-source web application framework written in Ruby. It is designed to make programming web applications easier by providing a full…
- Can I Install Phpmyadmin In Nginx Can I Install Phpmyadmin In Nginx? PHPmyadmin is a web-based management tool for databases such as MySQL and MariaDB. It is a popular tool for web developers and database administrators…