0

I'm having trouble installing/moving laravel to web server, i downloaded and set laravel on my local linux server but when i moved it to web server ,it shows a blank page. I uploaded the public folder contents to public_html and other contents outside the public, also i changed the public DIR from paths.php on bootstrap folder as follow: 'public' => __DIR__.'/../public_html/' so what is the exact problem? Please help me with this issue. Is composer a problem? or what?

3
  • Did you point it to the right path in the Document Root ? If you did, it should show up Commented Jan 18, 2015 at 14:09
  • @evoque2015 I moved the public contents on public html and other contents outside i changed the DIR for public in paths.php as follow: 'public' => DIR.'/../public_html/'. so what is the problem? i am using linux by the way. Commented Jan 18, 2015 at 14:13
  • See if this can help you: stackoverflow.com/questions/25724586/… Commented Jan 21, 2015 at 22:00

1 Answer 1

2

1) Create a new directory called ‘laravel4′ adjacent to ‘public_html’ so that your remote file structure now looks like this:

  • [.htpasswds]
  • [etc]
  • [laravel4]
  • [mail]
  • [public_ftp]
  • [public_html] etc etc varies depending on server 2) Upload the contents of your local ‘public’ directory to the remote directory ‘public_html’. Note: Be sure not to copy the whole ‘public’ directory, JUST it’s contents.

3) Upload everything else within your local Laravel project to the new remote ‘laravel4′ directory. Check: Now when you view the ‘laravel4′ folder over FTP/SSH/Whatever, you should see all your ‘app’ & ‘bootstrap’ directories along with all the other files and directories, but NOT ‘public’.

4) Edit the remote file ‘public_html/index.php’ and make the following change:

//from:
require __DIR__.'/../bootstrap/autoload.php';
//and
$app = require_once __DIR__.'/../bootstrap/start.php';

//to:
require __DIR__.'/../laravel4/bootstrap/autoload.php';
//and
$app = require_once __DIR__.'/../laravel4/bootstrap/start.php';

5) Edit the remote file ‘laravel4/bootstrap/paths.php’ and make the following change:

//from:
'public' => __DIR__.'/../public',
//to:
'public' => __DIR__.'/../../public_html',

6) That should be it. In my case, that was enough to restructure everything. Routes are working with the default .htaccess file. If you have problems, let me know, or ask on the ever-helpful

Reference: http://myquickfix.co.uk/2013/08/hosting-laravel-4-on-cpanel-type-hosting-public_html/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.