【发布时间】:2020-10-29 20:31:42
【问题描述】:
Laravel 得到 Internal Server Error 怎么解决?
这是我的 web.php 代码
Route::get('/', function () {
return view('index');
});
Route::get('/fleet', 'FleetController@index')->name('fleet');
Route::get('/offers', 'OffersController@index')->name('Offers');
当我链接到车队页面时,我会收到内部服务器错误。
我的文件夹是
resources
|-view
|--index.blade.php
|--fleet.blade.php
|--offers.blade.php
这是 index.blade.php 代码
<li class="nav-item"><a class="nav-link" href="{{ route('fleet') }}">Fleet</a></li>
<li class="nav-item"><a class="nav-link" href="{{ route('offers') }}">Offers</a></li>
如何解决?
我的 apache 设置是
DocumentRoot "D:\xampp\htdocs\laravel\wine\public"
我的 FleetController 代码
public function index()
{
return view('index');
}
舰队模型
class Fleet extends Model
{
//
}
还是报错
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at postmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 Server at localhost Port 80
【问题讨论】:
-
请尝试运行 artisan 命令
php artisan serve并使用服务链接而不是本地主机,看看错误是否消失
标签: laravel