【发布时间】:2015-11-15 15:24:32
【问题描述】:
我创建了一个 laravel 项目,该项目在 localhost 和我的托管服务器上运行良好,但是当我将它上传到客户端的服务器上时它就无法正常工作(他使用的是 bluehost)。
当我打开指向 /public 文件夹的 URL 时,它应该会显示主页。相反,它显示了所有文件和文件夹的列表(public 文件夹除外)。
当我尝试在浏览器中打开 myurl.com/public 或 myurl.com/public/index.php 时,出现以下错误:
Forbidden
You don't have permission to access /license/public/ on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
我可以通过 FTP 看到 public 文件夹,并且我已将 /app/storage 的权限更改为 777
这是我的 public/.htaccess:
<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>
我检查了我的 /public/error_log,它显示以下错误:
[21-Aug-2015 09:06:01] PHP Fatal error: require() [<a href='function.require'>function.require</a>]: Failed opening required '__DIR__/../bootstrap/autoload.php' (include_path='.:/usr/lib64/php:/usr/share/pear') in /home6/parentv3/public_html/eldercareapp/license/public/index.php on line 21
有什么帮助吗?
【问题讨论】:
-
这可能会让人觉得很愚蠢,但你做到了吗
composer install -
是的,当然
-
服务器上的PHP版本是多少?
-
@AdityaGiri 我很惊讶为什么我没有想到它。刚刚检查了服务器上的 PHP 版本及其 5.2.17。这就是所有这些混乱的原因。谢谢。
-
可以在这台服务器上升级 PHP 吗?它的 BlueHost,可以通过 cPanel 完成,还是我必须联系托管公司的支持?
标签: .htaccess laravel laravel-4