dongyou7472 2014-03-17 20:26
浏览 97
已采纳

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

When I uploaded my Laravel 4 application on a live web server I get the following error when going to the base 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

I have put my laravel-files in a separate folder next to public_html. In public html I put the content of laravel's public folder. This is my data structure:

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

In index.php I specified following lines:

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

and in laravel/bootstrap/paths.php:

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

On localhost everything runs fine, but when I upload it to my live web server, it won't work. I've been searching for days now and nothing can help me. Weird thing is that the two dots for going down a folder, won't work as they are just appended to my url instead of going down a folder.

Maybe it's because my web server is running on Php 5.3.27?

  • 写回答

1条回答 默认 最新

  • dp7311 2014-03-17 23:25
    关注

    You need at least PHP >= 5.3.7 with L4. And why don't you change the web root on the server instead? Is it shared hosting? You could also put all laravel install inside public_html, update bootstrap/path.php and index.php and redirect to laravel public with a htaccess. But this is definitely not recommended !

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog