0

The reason why I'm doing that is Laravel has the document root in a subdirectory is so that you don't have to expose your code to the public.

The folder structure in my localhost is

Test
    Test/laravel/
    Test/public_html/

where laravel contains all the folder of root without the public folder and public_html contains the public files.

And I have changed in below lines in public_html/index.php:

require __DIR__.'./../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'./../laravel/bootstrap/app.php';

I have followed the solution for solving the problem but couldn't solve it as I'm using 5.2. If anyone has done this before please provide a valid solution.

Thanks in advance.

Community
  • 1
  • 1
Hola
  • 2,163
  • 8
  • 39
  • 87

1 Answers1

1

Laravel already comes with the public directory (which would be easily renamed public_html). However, looking at your code, an issue lies at **./**../laravel/bootstrap/autoload.php'

This would end up with a directory like Test./ instead of Test/. Remove the period before the first slash.

require __DIR__.'/../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/app.php';
Devon Bessemer
  • 34,461
  • 9
  • 69
  • 95
  • But I'm getting Url like localhost/test/laraver/xxxx , But laravel shouldn't be add with the url like url should be like localhost/test/xxx .. So How do i remove the laravel from the url? – Hola Jun 22 '16 at 04:38