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/ [function.require]: failed to open stream: No such file or directory in /home/pvanmoll/domains/ on line 21

Fatal error: require() [function.require]: Failed opening required '/home/pvanmoll/domains/' (include_path='.:/usr/local/lib/php') in /home/pvanmoll/domains/ 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:


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 AttributeError: 'NoneType' object has no attribute 'drop_duplicates'报错
  • ¥15 编写c++计算器,用类和栈来做,要求如下
  • ¥15 以下代码,运行结果报错
  • ¥15 Vivado仿真数据出错
  • ¥15 银河麒麟不支持vant等前端框架怎么办?
  • ¥15 vue3的子组件在父页面调用不显示不生效问题
  • ¥15 cadence PEX
  • ¥15 phython创建了文件 显示在项目下面,但运行不了,运行时还是运行main文件,并且说main文件不允许并行运行
  • ¥20 C++哈希表的设计构造哈希表
  • ¥15 FutureWarning:不推荐使用空或全 NA 条目的 DataFrame 串联行为。怎么改呢?