0
votes

I have a problem with .htaccess file, I think this is all about it. When I trying to run my website on screen show errors:

Warning: require(DIR/bootstrap/autoload.php) [function.require]: failed to open stream: No such file or directory in /index.php on line 21

Warning: require_once(DIR/bootstrap/start.php) [function.require-once]: failed to open stream: No such file or directory in /index.php on line 35

Fatal error: require_once() [function.require]: Failed opening required 'DIR/bootstrap/start.php' (include_path='.:/:/usr/local/php/pear5') in /index.php on line 35

I found some solution but its not works. This is my .htaccess file:

 # Use PHP 5.3
 AddHandler application/x-httpd-php53 .php
<IfModule mod_rewrite.c>
  <IfModule mod_negotiation.c>
      Options -MultiViews
  </IfModule>
  RewriteEngine On

# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] </IfModule>

The version of php on my server is 5.3

Please help.

1
I assume your index page is inside public folder. How your url looks like?Hasib Mahmud
When I ran my app on localhost url looks like localhost:8080, I would like to do something similar on my server to avoid public in url. Url for server looks like website_name.biz, and that's alllukaszb
Ok, If your entire laravel framework is inside a folder guess webapp in htdocs And index.php is inside public folder i.e. htdocs/webapp/public/index.php, Try localhost:8080/webapp/public/.Hasib Mahmud
Doesnt work... This is my folder structure: appFolder -app -bootstrap -css -images -libs - .htaccess - index.php ... This structure works for localhost but on server the errors occured. My laravel folder is in vendor/laravellukaszb

1 Answers

0
votes

I think this will work. In your index.php file configure

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

instead of

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

and in bootstrap/paths.php change

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

to

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