How to deploy Laravel 5.5 app to Godaddy cPanel shared hosting

前端 未结 3 622
别那么骄傲
别那么骄傲 2021-02-06 17:30

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

3条回答
  •  离开以前
    2021-02-06 18:03

    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.

提交回复
热议问题