0
votes

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

1 Answers

1
votes

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 !