.htaccess - how to install laravel on sub domian shared host -
i create small registration system site laravel framework.
want upload on "shared host".
host control panel direct admin
.
1.first create sub domain this: reg.mydomain.me
. after created reg
folder on root directory , copy of laravel folders , files in that.
/home/mydomain.me/public_html/
i moved main file of laravel (app, boostrap, vendor, composer.json, composer.lock, phpunit.xml etc)
reg
folder **except public folder.opened
/home/username/main-laravel/bootstrap/paths.php
, edit this:replace 'app' => dir.'/../app', 'app' => dir.'/../../main-laravel/app',
replace 'public' => dir.'/../public', 'public' => dir.'/../../public_html/laravel',
replace 'base' => dir.'/..', 'base' => dir.'/../../main-laravel',
replace 'storage' => dir.'/../app/storage', 'storage' => dir.'/../../main-laravel/app/storage',
and create new folder inside public_html
' /home/username/public_html/reg/laravel '
i moved content in public folder of laravel 'public_html/reg/laravel' folder (step 4)
open /home/username/public_html/reg/laravel/index.php , edit this:-
replace require dir.'/../bootstrap/autoload.php'; require dir.'/../../main-laravel/bootstrap/autoload.php';
replace $app = require_once dir.'/../bootstrap/start.php'; $app = require_once dir.'/../../main-laravel/bootstrap/start.php';
but when run reg.mydomain.me blank page!!!
what can run laraval in subdomain ?
tnx
here step step method did host laravel 5 site on host gator baby plan.
step 1 - pre-requisite: (set ssh access on windows)
- check have ssh access host gator account. if not talk support team , give access ssh.
- download putty here access hostgator account windows. linux user don't need ssh present , accessible terminal
- you ready go. double click on putty , put ip , port enter username , password.
- check simple command "pwd" . "cd" , "cd ..". if feel problem till step, comment below
step 2- check php version (laravel 5 needs php v >= 5.4)
as have set ssh , can access account. need type commands check , setup php version. following command should show php 5.5.6 (cli) ....
$ php -v
if dont version > 5.4 dont worry. make .htaccess file in public_html folder , put following 1 line code.
addhandler application/x-httpd-php55 .php
step 3 - installing composer , laravel 5
- come putty. use pwd command , check in root directory (/home2/your_cpanel_name). if yes execute following command download composer.phar file @ root directory (/home2/your_cpanel_name/composer.phar)
curl -ss https://getcomposer.org/installer | php
- now run follwoing command anywhere.
php /home2/your_cpanel_name/composer.phar
- now composer installed , ready given in laravel 5 docs site. run following command
composer global require "laravel/installer=~1.1"
- now run command anywhere in directory structure install laravel.
~/.composer/vendor/bin/laravel new your_site_name
Comments
Post a Comment