Bablu Ahmed
Bablu Ahmed

Reputation: 5020

How to upload laravel 5.5 project to cpanel in addon domain

This is Bablu Ahmed. I want to upload my laravel 5.5 project into cpanel and my domain is an addon domain name is w3public.com and it's root directory is not inside the public_html it is outside the public_html (www.w3public.com). I have separated the project's files into two directories, one is www.w3public.com and another is laravel and I moved public folder's files into www.w3public.com and all other files into the laravel folder in cpanel that is given in screenshot below. I have also modified the index.php file of www.w3public.com as follows:

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

But it is not working. Can anyone help me with appropriate solutions?

Screenshot: enter image description here

Upvotes: 0

Views: 1809

Answers (1)

Ignacio Torres
Ignacio Torres

Reputation: 108

Your application should be installed in www.w3public.com and then change the root path from cpanel domains to the public folder inside laravel.

The best way to transfer files is git or the likes, but if they don't have it (usually is the case in shared hosting), you should use a ftp client, and if they don't allow that either, you can upload files/folders from cpanel (way too slow sadly). If you use git be careful since by default vendor folder is in the .gitignore (you have to run "composer update --no-dev" after all the files are transferred)

Make sure also that your ".env" (usually in .gitignore too, so you prob have to make one) file have your server database info.

Upvotes: 1

Related Questions