i have a pre-made laravel website and all the files in it are shown in this picture below:
image of files
my question is that how can i install larvel on cpanel and upload all these files?
in which folder should i place these files respectively ?
should i install laravel first and then upload these files on cPanel?
or should i directly upload these files on the server?
should there be any changes in coding after uploading these files?
2
Answers
You can do it with these steps.
1 – First make an new folder name anything it for eg:-myapp.
2 – Now in myapp folder paste all the files of public folder.
3 – And now in myapp folder make an new folder named anything like eg:-code.
4 – Now paste all the files and folder of remaining content of your laravel app except public folder content in code folder.
5 – Now the main thing open index.php file which is placed in myapp folder root.
6 – Change these two directory path require __DIR__.’/../vendor/autoload.php’; and $app = require_once __DIR__.’/../bootstrap/app.php’;.
7 – Just change the path these files with your new folder named code. like eg:- require __DIR__.’code/vendor/autoload.php’; and $app = require_once __DIR__.’code/bootstrap/app.php’; and it is done.
i.e. public_html ) Remove the public folder
DIR.’/../public’, into ‘public’ => DIR.’/..’,
and finally in index.php,
Change
into
Then Check you Laravel application