【发布时间】:2014-12-10 04:11:15
【问题描述】:
我的 .htaccess 文件有问题,我想这就是全部。当我尝试在屏幕上运行我的网站时显示错误:
警告:需要(DIR/bootstrap/autoload.php)[function.require]: 无法打开流:/index.php 中没有这样的文件或目录在线 21
警告:require_once(DIR/bootstrap/start.php) [function.require-once]:无法打开流:没有这样的文件或 第 35 行 /index.php 中的目录
致命错误:require_once() [function.require]:打开失败 需要'DIR/bootstrap/start.php' (include_path='.:/:/usr/local/php/pear5') 在 /index.php 第 35 行
我找到了一些解决方案,但它不起作用。 这是我的 .htaccess 文件:
# 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>
我服务器上的php版本是5.3
请帮忙。
【问题讨论】:
-
我假设您的索引页在公用文件夹中。你的网址是什么样子的?
-
当我在 localhost 上运行我的应用程序时,url 看起来像 localhost:8080,我想在我的服务器上做类似的事情以避免在 url 中公开。服务器的 URL 看起来像 website_name.biz,仅此而已
-
好的,如果你的整个 laravel 框架在一个文件夹中,猜想
webapp在htdocs和index.php在public文件夹内,即htdocs/webapp/public/index.php,试试localhost:8080/webapp/public/。 -
不起作用...这是我的文件夹结构:appFolder -app -bootstrap -css -images -libs - .htaccess - index.php ...此结构适用于本地主机,但在服务器上出现错误发生。我的 laravel 文件夹在 vendor/laravel