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 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?
  • ¥15 乘性高斯噪声在深度学习网络中的应用
  • ¥15 运筹学排序问题中的在线排序
  • ¥15 关于docker部署flink集成hadoop的yarn,请教个问题 flink启动yarn-session.sh连不上hadoop,这个整了好几天一直不行,求帮忙看一下怎么解决
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛