How to deploy Laravel 5.5 app to Godaddy cPanel shared hosting

mdailey77

I'm relatively new to Laravel. I'm confused on what is the proper way to deploy a Laravel 5.5 app to a Godaddy cPanel shared hosting. I've read multiple posts on the subject and they give conflicting advice.

Part of what I'm not clear on is do I copy all my files to the server and then run the following composer commands?:

composer install --optimize-autoloader and php artisan config:cache

I get the part where I should create a folder on the server outside of the public_html folder, placing all of the app files there except what is in the app's public subfolder.

If I want to run the app from a subfolder how would I do that? For example, www.mysite.com/laravelapp

The examples I found where for only running it from the public_html folder itself. Would it just involve changing the file paths in the www/index.php?

mdailey77

I figured out how to deploy Laravel on a Godaddy shared hosting plan after reading more posts about the subject. Here are the steps I took:

  1. Created a new folder outside the public_html folder and uploaded all of the app files to that folder except the vendor folder.
  2. Using SSH access, I ran the command curl -sS https://getcomposer.org/installer | php in the newly created app folder on the server.
  3. I removed the public folder from the Laravel app folder, placed it inside the public_html folder and renamed it to the name of my project.
  4. I modified the file paths in the index.php in the project folder so they pointed to the laravel app folder like so:

    require __DIR__.'/../../laravel/bootstrap/autoload.php';

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

  5. I installed the dependencies by running the command in SSH: php composer.phar install, then adding the necessary cache by running: php artisan config:cache

That was it. I did it using Godaddy cPanel shared hosting. Before attempting this make sure the PHP version is set to 7.1. I wanted to post my steps because I found some of the tutorials on this subject either were confusing, gave conflicting advice or didn't provide all the necessary steps.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to Deploy Laravel 5 on shared cPanel hosting

How to deploy node + react App on goDaddy shared hosting

How can I update my composer in the godaddy shared hosting developed with the laravel 5

Deploy Laravel 5 using only FTP in a shared hosting

Shared hosting: WordPress/laravel 5

how to run laravel 5 in shared hosting without composer?

How to host Laravel 5.2 in GoDaddy shared hosting without SSH?

Laravel 5 – Clear Cache in Shared Hosting Server

How to deploy a Laravel-Vue project on shared server (GoDaddy)

Laravel, Using a cPanel shared hosting if possible?

Laravel schedule job on cpanel shared hosting not working

Laravel 5.5 Error 500 in Cpanel Shared Hosting

How to deploy a simple Angular2 app on a shared hosting?

How to install composer on godaddy shared hosting?

cPanel Themes and shared hosting

Laravel 5 issues on shared hosting with pathinfo() and unwritable directory

Laravel 5 on shared hosting - wrong public_path()

Reloading .env variables without restarting server (Laravel 5, shared hosting)

Laravel cron job runs in localhost but not in my shared hosting with cpanel

How to deploy lumen framework on shared hosting (subdomain)

Hosting react app on godaddy

CronJob not starting in GoDaddy Shared hosting

Installing Ruby on Godaddy Shared Hosting

how to host angular and node js project on the shared hosting (cpanel or plesk)?

How to deploy react app to godaddy server?

How do I deploy two Laravel 7 project into shared hosting at hostGator?

How to migrate a sub-domain from a shared hosting cpanel to a VPS cpanel

Parse error after deploy Laravel 5.1 on shared hosting

How to deploy django app on hosting service

TOP Ranking

HotTag

Archive