PHP Fatar错误:在第50行Laravel的index.php中调用成员函数make() [英] 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
我的Laravel public/index.php
是默认设置.
My laravel public/index.php
is as it was default.
某些点:-
- 此站点在localhost中运行正常
- 但是,同一站点无法在服务器上工作.
我已经完成并尝试过的事情:
- 检查所有文件和文件夹的chmod.
2 ..
storage
目录和目录/文件是可写的. - 交叉检查index.php文件已经10次了,没有发现错误.
- 在index.php文件中文件可读性很好,没有文件丢失,也没有文件打开.
- Checked chmod of all file and folder.
2..
storage
directory and directory/files is writable. - Cross checked index.php file already 10 time now and see no error.
- files are perfectly readable in index.php file and no file is missing nor any file is missing to open.
我正在用5.6版的php运行Centos 6.8.我的Laravel版本是5.2
I am running Centos 6.8 with php version 5.6. My Laravel version is 5.2
如果有人需要我的index.php:-
My index.php if some one needs them :-
<?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);
推荐答案
该错误表明第50行的make()
方法
The error indicates that the make()
method on line 50
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
没有在对象上调用
.通常,您的$app
变量将保存Illuminate\Foundation\Application
的实例.
它是通过require
ing __DIR__.'/../bootstrap/app.php';
来实现的.
is not called on an object. Normally your $app
variable would hold an instance of Illuminate\Foundation\Application
.
It does that via require
ing __DIR__.'/../bootstrap/app.php';
.
请检查文件bootstrap/app.php
是否存在并且内容正确.
Please check if the file bootstrap/app.php
is present and has the right content.
这篇关于PHP Fatar错误:在第50行Laravel的index.php中调用成员函数make()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!