{"id":26871290,"url":"https://github.com/codeadamca/whc-deploy-laravel","last_synced_at":"2026-02-15T12:39:27.246Z","repository":{"id":274370639,"uuid":"626543045","full_name":"codeadamca/whc-deploy-laravel","owner":"codeadamca","description":"A basic description of how to deploy a Laravel application to a shared web hosting package. ","archived":false,"fork":false,"pushed_at":"2025-01-26T21:33:09.000Z","size":845,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T06:38:18.706Z","etag":null,"topics":["deployment","laravel","mysql","php","whc"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/codeadamca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-11T17:17:30.000Z","updated_at":"2025-01-26T21:33:12.000Z","dependencies_parsed_at":"2025-01-26T22:35:28.118Z","dependency_job_id":null,"html_url":"https://github.com/codeadamca/whc-deploy-laravel","commit_stats":null,"previous_names":["codeadamca/whc-deploy-laravel"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codeadamca/whc-deploy-laravel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fwhc-deploy-laravel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fwhc-deploy-laravel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fwhc-deploy-laravel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fwhc-deploy-laravel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeadamca","download_url":"https://codeload.github.com/codeadamca/whc-deploy-laravel/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeadamca%2Fwhc-deploy-laravel/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278710890,"owners_count":26032541,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","laravel","mysql","php","whc"],"created_at":"2025-03-31T07:19:01.096Z","updated_at":"2025-10-07T02:45:45.719Z","avatar_url":"https://github.com/codeadamca.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deploying Laravel to WHC\n\nA basic description of how to deploy a Laravel applications to a shared web hosting package. In this example I am using [Web Hosting Canada](https://whc.ca/).\n\n## Register\n\nFirst register for a shared [WHC](https://whc.ca/) account. I'm using the [Pro shared hosting package](https://whc.ca/canadian-web-hosting). Hosting on [WHC](https://whc.ca/) will work quite similarly to other shared web hosting packages such as GoDaddy, HostPapa, BlueHost, etc...\n\nWhen you register with [WHC](https://whc.ca/) you will receive an email with your cPanel/FTP username and password. If you don't reaceive this email, you can change your password from the `Client Area`:\n\n![Change Password](_readme/screenshot-whc-change-password.png)\n\nAnd find your username from logging into `cPanel`:\n\n![Username](_readme/screenshot-whc-username.png)\n\n## Database\n\nUsing `cPanel` create a new MySQL username and database. And make sure to grant your new user permission to your new database. For now you can give the new MySQL user full premissions to the databae:\n\n![Database Permissions](_readme/screenshot-whc-permissions.png)\n\n## FTP\n\nConnect to your hostting account using FTP. The IP address is availble on the right had side of your `cPanel` under `Shared IP Address`. You can use the same username and password from the Registration step:\n\n![IP Address](_readme/screenshot-whc-ip-address.png)\n\nOnce you have connected to your hosting using FTP, navigate to the `public_html` fodler and upload the contents of the `public` folder from your Laravel project. Navigate back to the original folder (`../public_html`) and create a folder named `laravel`. Upload everything to this folder except the `public` and `vendor` folders. \n\n## PHP Versions\n\nOn the `cPanel` dashboard, find the `Select PHP Version` tool and change the `Current PHP verion` to `PHP 8.1`. \n\nOn the `cPanel` dashboard, find the `MultiPHP Manager` tool and make sure your domain is set to `inherited`. If it isn't, select the checkbox for your domain and choose `inherit` from the drop down. \n\n![Change Password](_readme/screenshot-whc-inherit.png)\n\n## Environment Variables\n\nUsing the `File Manager`, edit the `.env` file and change the database credentials to your new database username and password:\n\n```php\nDB_CONNECTION=mysql\nDB_HOST=localhost\nDB_PORT=3306\nDB_DATABASE=\u003cDB_DATABASE\u003e\nDB_USERNAME=\u003cDB_USERNAME\u003e\nDB_PASSWORD=\u003cDB_PASSWORD\u003e\n```\n\n\u003e [!Note]  \n\u003e If there is a `DB_SOCKET` variable, you can remove this.\n\n## Public App Reference\n\nUsing the `File Manager` tool, edit the `/public_html/index.php` file. Change the three file references to include the `laravel` folder. Change this:\n\n```php\nif (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {\n    require $maintenance;\n}\n```\n\nTo this:\n\n```php\nif (file_exists($maintenance = __DIR__.'/../laravel/storage/framework/maintenance.php')) {\n    require $maintenance;\n}\n```\n\nAnd make the same change to the other two similar lines of code.\n\n## Composer and Migrations\n\nOn the `cPanel` dashboard, find the `Terminal` tool. If you type `ls` you will see a list of the directory contents. Change the directory to the `laravel` folder:\n\n```sh\ncd laravel\n```\n\n![Folder Contents](_readme/screenshot-whc-terminal-content.png)\n\nRun composer:\n\n```sh\ncomposer install\n```\n\nAnd run your migrations:\n\n```sh\nphp artisan migrate:fresh --seed\n```\n\n## Test\n\nOpen your domain to see if it's working. \n\nIf it's not, turning on `display_errors` will help. Open the `Select PHP Version` tools and the `Options` tab. Check off `display_errors`.\n\n![PHP display_errors](_readme/screenshot-whc-errors.png)\n\n***\n\n## Repo Resources\n\n* [laravel-blade-cms](https://github.com/codeadamca/laravel-blade-cms)\n* [Laravel](https://laravel.com/)\n* [Web Hosting Canada](https://whc.ca/)\n\n\u003cbr\u003e\n\u003ca href=\"https://codeadam.ca\"\u003e\n\u003cimg src=\"https://cdn.codeadam.ca/images@1.0.0/codeadam-logo-coloured-horizontal.png\" width=\"200\"\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fwhc-deploy-laravel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeadamca%2Fwhc-deploy-laravel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeadamca%2Fwhc-deploy-laravel/lists"}