iklan

✔ Laravel 5.7 Tutorial : How To Deploy Laravel 5* Projects On Cpanel Shared Hosting??

Laravel 5.7 Tutorial for Beginners : How to Deploy Laravel 5* Projects on cPanel Shared Hosting?? here's i'll show you simple upload laravel 5* projects and setting laravel on shared hosting or cPanel. This is important to know that laravel 5.1 up to laravel 5.4 is supported with PHP 5.6.4, but if your project build on Laravel 5.5 or newer your php server must PHP 7.0 or newer.

You can see more server requirements on this link https://laravel.com/docs/5.7

Video Tutorial Deploy Laravel 5 Projects to cPanel


Access cPanel

Go to your cPanel’s login page using its access IP address provided by your hosting provider.

Now log in to your cPanel and it will look like this. In this tutorial, we can upload laravel project using File Manager, MySQL® Databases, and phpMyAdmin features in cPanel.

But, on this tutorial i'll use WinSCP that SFTP and FTP client, d0wnl0ad it from this link https://winscp.net/eng/index.php

Upload Laravel Project's

Using WinSCP please login with your FTP account and upload your laravel project into cPanel on Root directory (/).

After finished, move all file in the public folder of your laravel project to your public_html folder (/public_html/ or /public_html/newfolder/).

After all file (public file) has moved into public_html folder, just update your index.php with this code..

If your app is on /public_html/

require __DIR__.'/../laravel/bootstrap/autoload.php'; $app = require_once __DIR__.'/../laravel/bootstrap/app.php';

If your app is on other folder  /public_html/newfolder/

require __DIR__.'/../../laravel/bootstrap/autoload.php'; $app = require_once __DIR__.'/../../laravel/bootstrap/app.php'; 

So, you can access you application by following this address :
http://yoursite.com/
or
http://yoursite.com/newfolder

Connect to Databases

Assuming you are using Laravel with MySQL (which is the most common stack preferred by many), I will explain how to connect your MySQL database with the deployed project.You have to first create your database on your Shared hosting server. Open your cPanel and go to MySQL® Databases page.

Under Create New Database section, give your database a name and create database. Page will refresh and under Current Databases section, you will see your new database is also listed. Now go to MySQL Users section and create a database user. Your page will refresh and you will see your new user listed under the Current Users section. Now go to the Add User To Database Section and select your new user and new database, so that your user now can access and modify your database.

Update .ENV file

Onep your laravel folder on root directory, than update .env and update the following fields with new database information
 DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel54 DB_USERNAME=root DB_PASSWORD=null

More Laravel Video Tutorial



Just like and subscribe our channel and get more awesome tutorial everyday for free. keep coding and see you next lessons ..

Sumber http://scqq.blogspot.com

Berlangganan update artikel terbaru via email:

0 Response to "✔ Laravel 5.7 Tutorial : How To Deploy Laravel 5* Projects On Cpanel Shared Hosting??"

Posting Komentar

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel