【发布时间】:2018-06-07 19:19:29
【问题描述】:
当我尝试运行我的项目时,它会下载一个包含以下代码的文件。我不知道这背后的原因是什么。请指导我解决这个问题
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author
Taylor Otwell <taylor@laravel.com>
*/
/*
|--------------------------------------------------------------------------
|
Register The Auto Loader
|--------------------------------------------------------------------------
|
|
Composer provides a convenient, automatically generated class loader for
| our application.
We just need to utilize it! We'll simply require it
| into the script here so that we don't
have to worry about manual
| loading any of our classes later on.
It feels nice to relax.
|
*/
require __DIR__.'/../bootstrap/autoload.php';
/*
|--------------------------------------------------------------------------
|
Turn On The Lights
|--------------------------------------------------------------------------
|
|
We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and g
ets it ready for use, then it
| will load up this application so that we can run it and send
|
the responses back to the browser and delight
our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
/*
|--------------------------------------------------------------------------
|
Run The Application
|--------------------------------------------------------------------------
|
|
Once we have the application, we can handle the incoming request
| through the kernel, and
send the associated response back to
| the client's browser allowing them to enjoy the
creative
| and wonderful application we have prepared
for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
【问题讨论】:
-
我认为缺少一些扩展laravel.com/docs/5.5/installation
-
我认为您的系统中缺少 php env,您是否安装了 php?
-
尊敬的先生,我的许多 Laravel 项目已经在我的系统上运行。我下载了我的项目并尝试在我的本地主机和新的托管服务器上运行它,所以当我点击 URL 时它下载了一个文件。使用以下我最常用的代码
-
我的项目中有 env 文件
-
项目的url输入错误会报错吗?