【发布时间】:2015-08-31 05:38:04
【问题描述】:
这是我第一次上传到 Laravel 站点的远程服务器。
本地我已经配置了一个虚拟主机,所以我对我的网站的访问是这样的:
site.domain.com //it's pointing htdocs/laravel-proyect/public
我已将我的网站上传到我的远程服务器,然后:
- 更改存储及其所有目录的权限
- 将权限更改为引导程序
-
改变app.php的配置
'url' => 'http://site.domain.com',
使用新参数(以及 email.php)更改 database.app 中的配置
- 加载数据库中的所有表和数据
然后我尝试加载我的网站并收到 500 内部服务器错误
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
有点用,我在 routes.php 中有这段代码:
// Begins in the login view
Route::get('/', function()
{
if (!Sentry::check()) {
$data = array();
if (Session::has('email')) {
$data = array('email' => Session::get('email'));
}
return Redirect::route('login', $data);
}
else
return Redirect::route('users');
});
/ ========================================
// LOGIN, LOGOUT AND ACTIVATION SECTION ==========
// // ============================================
// show the login page
Route::get(MyHelpers::textLang('login','routes'), array('as' => 'login', function()
{
if (Sentry::check())return Redirect::route('users');
else {
$rules = User::$rules_login;
// show the login page (app/views/frontend/login.blade.php)
return View::make('frontend.login', compact('rules'));
}
所以第一次mo url看起来像:
site.domain.com/entrar
'entrar', (用西班牙语登录), y 由 MyHelpers::textLang('login','routes') 设置,访问我的类 MyHelpers 和 lang 文件以将 'login' 翻译成 'entrar',但不要加载模板。
开始:
- 阅读文档,进行一些更改:从 .htaccess(已弃用),也将 RewriteBase 添加到 .htaccess。
- 将 /public 内容复制到基本目录并更改 bootstrap/paths 中的路径和 在 index.php 文件中。
- 在两个远程服务器中重新安装以验证我的提供程序是否失败(同样的错误)。与我的提供者交谈,配偶 服务器上没有错误。
- 我在基础目录中创建了一个新的 htaccess,将路由重定向到 /public。
- 尝试使用 php 5.4、5.5 和 5.6
其实我的.htaccess是:
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]
我没有更多想法,也找不到与此处相关的其他解决方案。
有什么想法吗?拜托,我快疯了,在星期三我必须开始一个新的项目,并且仍在使用这个项目。
谢谢
【问题讨论】:
-
首先查看错误日志以了解有关 500 的详细信息。在您知道问题所在之前,不要四处尝试不同的东西。
-
谢谢@Mark,我无法访问服务器日志,我的提供商告诉我,服务器似乎无法加载某些文件。
-
您无法访问自己的(错误)日志,请他们给您一份错误日志的复制粘贴,或者只是转向更专业的服务,这太荒谬了。在开发过程中,您将遇到 500 多个日志,对于访问这些日志的开发人员来说至关重要。 500 个错误已经由简单的拼写错误产生。
-
我为他们服务。前段时间我可以访问,现在无法访问公共目录,是一个多域站点,配置选项很差(简单,但很差)
-
如果我删除 de .htcaccess 并使用 'site.com/index.php' ,则一切正常
标签: php apache laravel-4 web-deployment remote-server