【问题标题】:Laravel 4 bootstrap/autoload.php failed to open streamLaravel 4 bootstrap/autoload.php 无法打开流
【发布时间】:2014-03-17 20:26:11
【问题描述】:

当我在实时 Web 服务器上上传 Laravel 4 应用程序时,我在访问基本 URL 时收到以下错误:

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',

在本地主机上一切正常,但是当我将它上传到我的实时网络服务器时,它就无法正常工作了。我已经找了好几天了,没有什么能帮助我。奇怪的是,用于进入文件夹的两个点不起作用,因为它们只是附加到我的 url 而不是进入文件夹。

可能是因为我的网络服务器在 PHP 5.3.27 上运行?

【问题讨论】:

    标签: php laravel-4


    【解决方案1】:

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

    【讨论】:

    • 那么是php版本的问题?因为我读到这不会导致这个问题。无论如何,有没有办法我自己可以在共享主机上更新 PHP?还是我必须向我的主机提供商询问这个?
    猜你喜欢
    • 2015-04-12
    • 2016-09-04
    • 2020-01-16
    • 1970-01-01
    • 1970-01-01
    • 2014-11-25
    • 1970-01-01
    • 2022-01-03
    相关资源
    最近更新 更多