【发布时间】:2015-09-22 13:40:19
【问题描述】:
我已将Laravel-5 项目上传到demo folder 内部的服务器,但是当我访问mydomain.com/demo 时,我什么也没有得到,即空白页。我实际上找不到正在发生的事情,我认为这是因为 .htaccess 文件或其他原因。
demo folder 中的文件夹结构如下:
我的.htaccess 文件:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
我的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__.'/CMS/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__.'/CMS/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');
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
当我查看 error_log 文件时,我在最后一行发现了这些
[22-Sep-2015 09:48:07 America/Detroit] PHP Fatal error: require(): Failed opening required '/home/axilcrea/public_html/demo/CMS/bootstrap/../vendor/autoload.php' (include_path='.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php') in /home/axilcrea/public_html/demo/CMS/bootstrap/autoload.php on line 17
我的debug 在app 文件中设置为true。我需要帮助。
【问题讨论】:
-
当我在 (/var/www/html/siddhartha/CMS) localhost 中运行 php artisan serve 时出现错误 PHP 致命错误:require(): Failed opening required '/var/www/html/ siddhartha/CMS/app/http/helpers/backend/helpers.php' (include_path='.:/usr/share/php:/usr/share/pear') 在 /var/www/html/siddhartha/CMS/vendor /composer/autoload_real.php 第 54 行
标签: php laravel laravel-5 cpanel