我在我的 cpanel 中托管 laravel 5.1,但它总是出错。我尝试了每种方法(htaccess、chmod 644 和 storage give o r+W),但它在我的 cpanel 中不起作用,但是当我从索引中删除以下行时。公共(public)文件夹的 php 它可以访问 index.php 文件:
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
所以它可以访问我的文件夹。有谁能够帮助我?可能是由于 cpanel 的 php 版本造成的吗?
最佳答案
将此代码粘贴到您的 index.php 文件的顶部,该文件将位于公共(public)文件夹中:
ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);
然后访问你的项目的 URL,你会看到这个问题,因为哪个 laravel 抛出了这个错误。
关于server - cpanel托管中的laravel服务器错误500,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35618108/