服务器上的laravel5.2项目返回一个空白页面

时间:2016-10-03 01:26:45

标签: php apache laravel-5 ubuntu-14.04

laravel5.2项目在本地运行良好,但在上传服务器时返回空白页面(ubuntu14.04 + apache + php5.5.9)。

我有 bootstrap / cache 存储目录的写入权限777

chmod -R 777 bootstrap/cache
chmod -R 777 storage

permission screenshot

error.log

[Mon Oct 03 08:14:46.966114 2016] [:error] [pid 2942] [client 121.249.196.77:58256] PHP Parse error:  syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /var/www/html/blog/vendor/laravel/framework/src/Illuminate/Foundation/helpers.php on line 475

第475行

line 475 screenshot

路线/ web.php

Route::get('/','HomeController@index');
Route::any('article','BlogController@index');
Route::any('article/{id}','BlogController@show');
Route::any('classify/{tag}','BlogController@tag');
Route::any('station','StationController@index');
Route::any('about','AboutController@index');
Route::any('admin/login','AdminController@login');
Route::any('admin/check','AdminController@check');
Route::any('admin/logout','AdminController@logout');
Route::group(['middleware' => 'admin.login'],function(){
       Route::any('upload','UploadController@index');
       Route::any('upload/operate','UploadController@operate');
       Route::resource('articleManage','ArticleController');
});

的.htaccess

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

公共/ index.php的

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

我尝试了很多方法,但页面仍然是空白的。有什么建议吗?先谢谢。

0 个答案:

没有答案