鍍金池/ 問答/云計(jì)算  PHP/ 阿里云服務(wù)器部署laravel無法訪問index.php頁

阿里云服務(wù)器部署laravel無法訪問index.php頁

先放一張public文件夾的目錄結(jié)構(gòu)圖:

clipboard.png

購買的是阿里云Linux 的ubuntu 16.x.x 系統(tǒng)
在上面部署laravel項(xiàng)目,配置了訪問public文件夾下的index文件,但是為什么 不能訪問?
index.php內(nèi)容:

<?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 great 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);

報(bào)錯(cuò)圖:

clipboard.png

我試著替換了一下index.php的內(nèi)容,換成這種簡(jiǎn)單的是可以顯示的

clipboard.png

clipboard.png

但是如果換成自己項(xiàng)目原有的index.php文件就報(bào)錯(cuò)了

回答
編輯回答
真難過

建議你,
首先打開 php.ini 搜索 display_errors,把 Off 修改為 On,開啟 php 錯(cuò)誤提示
看看具體報(bào)什么錯(cuò)誤,再去解決。
比如存在的問題:composer沒有安裝依賴,目錄沒有寫權(quán)限,開啟了錯(cuò)誤提示,看看錯(cuò)誤再說

2018年2月24日 02:25