2015-09-21 18 views
0

iam上传的项目到服务器后出现错误。当我访问链接somedomain.com/DEMO我得到以下错误。这个错误究竟是什么?我怎么解决它,请帮助我。无法在服务器laravel5中生活的网站

Warning: require(/home/siddins/public_html/DEMO/project/app/http/helpers/backend/helpers.php): failed to open stream: No such file or directory in /home/siddins/public_html/DEMO/project/vendor/composer/autoload_real.php on line 54 

Fatal error: require(): Failed opening required '/home/siddins/public_html/DEMO/project/app/http/helpers/backend/helpers.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/siddins/public_html/DEMO/project/vendor/composer/autoload_real.php on line 54 

我的index.php是这样的:

<?php 
/** 
* Laravel - A PHP Framework For Web Artisans 
* 
* @package Laravel 
* @author Taylor Otwell <[email protected]> 
*/ 

/* 
|-------------------------------------------------------------------------- 
| 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__.'/project/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__.'/project/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); 

项目主文件夹。里面projetc我有app,vendor,bootstrap,config,database,resources

+0

你有没有重命名或移动您的'/ public'文件夹? –

+0

我有重命名/公共文件夹 –

+0

请投影您的示例项目结构。 –

回答

0

此文件不存在:

/home/siddins/public_html/DEMO/project/app/http/helpers/backend/helpers.php

+0

但在后端文件夹“backend/helpers.php” –

+0

中有一个文件helpers.php,您正在发布相对URL。发布完整的URL开始/ – Nelson

+0

好吧,我有这个项目/应用程序/ Http /助手/后端/ helpers.php –

1

下面是一些最好的做法,同时推出对服务器Laravel应用程序。 尝试一下。可能解决你的问题。这些步骤已经解决了我在服务器上启动一个站点之前所面临的几乎所有问题。

1.启用mod_rewrite的

a2enmod rewrite 

2.安装PHP 5.6

sudo apt-get install software-properties-common 
sudo add-apt-repository ppa:ondrej/php5-5.6 
sudo apt-get update 
sudo apt-get upgrade 
sudo apt-get install php5 
  • 虽然返回视图,始终使用的Foldername.viewname代替Foldername\viewname

  • 使用public_path()同时包含文件

  • chmod -R 777 “存储文件夹路径”

  • +0

    当我访问somedomain.com/demo时,我收到了空白页面 –

    +0

    尝试检查错误日志,最有可能是因为PHP版本...您可能低于5.6 –

    +0

    我有空白页 –

    相关问题