Laravel 4 bootstrap / autoload.php无法打开流

时间:2014-03-17 20:26:12

标签: php laravel-4

当我在实时网络服务器上上传我的Laravel 4应用程序时,在转到基本网址时出现以下错误:

Warning: require(/home/pvanmoll/domains/iheal.be/public_html/../laravel/bootstrap/autoload.php) [function.require]: failed to open stream: No such file or directory in /home/pvanmoll/domains/iheal.be/public_html/index.php on line 21

Fatal error: require() [function.require]: Failed opening required '/home/pvanmoll/domains/iheal.be/public_html/../laravel/bootstrap/autoload.php' (include_path='.:/usr/local/lib/php') in /home/pvanmoll/domains/iheal.be/public_html/index.php on line 21

我已将laravel文件放在public_html旁边的单独文件夹中。在公共html中我放了laravel的公共文件夹的内容。 这是我的数据结构:

laravel
   /app
   /bootstrap
   /vendor
   ...
public_html
   /css
   /js
   index.php
   ...

在index.php中,我指定了以下几行:

require __DIR__.'/../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/start.php';

并在laravel / bootstrap / paths.php中:

'public' => __DIR__.'/../../public_html',

在localhost上,一切运行正常,但是当我将它上传到我的实时网络服务器时,它无法正常工作。我现在一直在寻找几天,没有什么可以帮助我。奇怪的是,用于下载文件夹的两个点不会起作用,因为它们只是附加到我的URL而不是下到文件夹。

也许是因为我的网络服务器在Php 5.3.27上运行?

1 个答案:

答案 0 :(得分:1)

L4至少需要PHP> = 5.3.7。为什么不改变服务器上的Web根目录呢?它是共享主机吗? 您还可以将所有laravel安装放在public_html中,更新bootstrap / path.php和index.php并使用htaccess重定向到laravel public。但绝对不推荐这个!