dongsu4345 2015-05-04 03:02
浏览 48

无法将laravel重定向到根文件夹

I installed laravel on folder laravel in www and it works fine. I wanted to make it work on root, so I moved all folders except public into www/laravel and public folder content in www and I modified 2 lines in index.php in www to:

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

and in laravel/bootstrap/paths.php, I modified one line to:

'public' => __DIR__.'/../../public_html'

but when I try access localhost, I get this error:

( ! ) Warning: require(C:\wamp\www/../laravel/bootstrap/autoload.php): failed to open stream: No such file or directory in C:\wamp\www\index.php on line 21

( ! ) Fatal error: require(): Failed opening required 'C:\wamp\www/../laravel/bootstrap/autoload.php' (include_path='.;C:\php\pear') in C:\wamp\www\index.php on line 21

How can I fix it?

  • 写回答

2条回答 默认 最新

  • dreamMyDream2014 2015-05-04 03:19
    关注

    it seem to work on fine in Laravel 5

    move public/index.php to rood directory and edit 2 line

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

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

    and

    line 35 $app = require_once __DIR__.'/../bootstrap/app.php';

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

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line