Laiba
Laiba

Reputation: 25

uploading a pre-made laravel website on cPanel

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?

Upvotes: 0

Views: 189

Answers (2)

pardeep
pardeep

Reputation: 359

  1. First Copy all files and folders in /public html
  2. Copy all content of public folder and paste it in document root ( i.e. public_html ) Remove the public folder
  3. Open your bootstrap/paths.php and then changed 'public' => DIR.'/../public', into 'public' => DIR.'/..',

and finally in index.php,

Change

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

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

into

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

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

Then Check you Laravel application

Upvotes: 0

Rajat Masih
Rajat Masih

Reputation: 583

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.

Upvotes: 1

Related Questions