PHP Fatar Error: call to a member function make() in index.php on line 50 Laravel

PHP Fatar Error: call to a member function make() in index.php on line 50 Laravel

我遇到以下错误:-

PHP Fatal error:  Call to a member function make() on string in /home/karaoke/web/example.com/public_html/index.php on line 50
PHP Stack trace:
PHP   1. {main}() /home/karaoke/web/example.com/public_html/index.php:0

我的laravelpublic/index.php是默认的。

某些点:-

  1. 此网站在本地主机上运行良好
  2. 但是,同一站点无法在服务器上运行。

我已经做过和尝试过的事情:

  1. 已检查所有文件和文件夹的 chmod。 2.. storage目录和directory/files是可写的。
  2. 交叉检查 index.php 文件现在已经 10 次并且没有发现错误。
  3. 文件在 index.php 文件中完全可读,没有文件丢失,也没有任何文件丢失无法打开。

我是 运行 Centos 6.8,php 5.6 版。我的 Laravel 版本是 5.2

我的 index.php 如果有人需要它们:-

<?php

/**
 * Laravel - A PHP Framework For Web Artisans
 *
 * @package  Laravel
 * @author   Taylor Otwell <taylorotwell@gmail.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 gets 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);

$app->run($app->make('request'));

你可以试试把这个加进去public/index.php

报错说明第50行的make()方法

$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);

未在对象上调用。通常你的 $app 变量会保存 Illuminate\Foundation\Application 的一个实例。 它通过 requireing __DIR__.'/../bootstrap/app.php';.

做到这一点

请检查文件 bootstrap/app.php 是否存在且内容是否正确。