laravel 5.2不在服务器上工作403错误

问题描述 投票:1回答:1

我有一个从GitHub中获取的Laravel项目,它在localhost上正常工作,但它不能在服务器上发出403错误,index.php文件在公共目录中。

require __DIR__.'/../bootstrap/autoload.php';    
$app = require_once __DIR__.'/../bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);

如果我把index.php放在root中,它的工作原理是css和js文件不能正常工作。

谢谢

php laravel laravel-5.2
1个回答
1
投票

在您的Web服务器上,主目录必须指向公共目录。在Froxlor上是DocumentRoot:path / to / public / On cPanel是Root dir(在我的例子中)

您也可以将索引文件放在根目录中,但不建议这样做,因为您必须改变路径。这就是你的css和js文件无法正常工作的原因。

© www.soinside.com 2019 - 2024. All rights reserved.