php - How to host a site made with laravel 5 on a actual server? -
i have made site using laravel 5 framework, have made site on local server(localhost). want host site other sites host on server, when uploaded files server, didn't work, giving me error.
i have searched on google didn't find perfect solution this. think changes need done in .env file or other file.
can tell me changes have make can run site in local server? , 1 more thing: have install composer , laravel on hosting server run files or not?
1.- setup project laravel 5 in localhost correctly configured
2.- double check server configuration of php 5.4 (this because every little change on .htaccess file may change config)
3.- create directory in same level of public_html , put project inside of folder.
4.- put content of public (l5) directly on public_html (be aware of don't overwrite .htaccess file accidentally)
now... "tricky part"... structure
perl5
php
public_html
[framework-folder]
ssl
inside of public_html
u can see files of public directory of laravel 5
go index.php , edit line 22
#from require __dir__.'/../bootstrap/autoload.php'; #to require __dir__.'/../[framework-folder]/bootstrap/autoload.php';
and on line 36
#from $app = require_once __dir__.'/../bootstrap/app.php'; #to $app = require_once __dir__.'/../[framework-folder]/pulcro/bootstrap/app.php';
the final step edit .htaccess
file , add lines
rewriteengine on # redirect trailing slashes... rewritecond %{request_uri} !^ rewriterule ^(.*)$ /$1 [l]
Comments
Post a Comment