Laravel 4 500内部服务器
首先,我想说,我已经阅读并尝试了所有其他问题在这里与相同的标题,但我仍然得到相同的错误500 我有XAMPP本地和一切工作正常,问题是当我上传到我的网站托管网站 索引位于公用文件夹中,工作正常,但当我尝试转到/finder时,我得到了500页 这是我的文件的结构:Laravel 4 500内部服务器,laravel,laravel-4,Laravel,Laravel 4,首先,我想说,我已经阅读并尝试了所有其他问题在这里与相同的标题,但我仍然得到相同的错误500 我有XAMPP本地和一切工作正常,问题是当我上传到我的网站托管网站 索引位于公用文件夹中,工作正常,但当我尝试转到/finder时,我得到了500页 这是我的文件的结构: public/index.php its ok app/views/finder.php 500 error 这是我的路线文件: Route::get('/', function() { return View::make
public/index.php its ok
app/views/finder.php 500 error
这是我的路线文件:
Route::get('/', function()
{
return View::make('index');
});
Route::get('finder', 'ApartmentsController@finder');
这是我的访问权限
选项-多视图
有什么建议吗
提前谢谢
更新:
问题不在htaccess中,问题在方法finder()中,正好在查询生成器中,但为什么它在本地工作??:
$searchResult=DB::table('books')->join('apartments', 'apartment_id', '=', 'apartments.id');
if(((count($tipo)==NULL)||(count($tipo)==1)) && $tipo[0]==''){
}else if (count($tipo)==1){
$searchResult->where('apt_type','=',$tipo[0]);
}else{
$searchResult->where(function($query){
//Here is the problem, if I delete this piece of code everything works $query->where('apt_type','=',Input::get( 'tipo' )[0]);
for ($i=1;$i<count(Input::get( 'tipo' ));$i++){
$query->orwhere('apt_type','=',Input::get( 'tipo' )[$i]);
}
});
}
$searchResult=DB::table('books')->join('partments','partments_id','=','partments.id');
如果((count($tipo)==NULL)| |(count($tipo)==1))&&$tipo[0]==“”){
}否则如果(计数($tipo)==1){
$searchResult->where('apt_type','=',$tipo[0]);
}否则{
$searchResult->where(函数($query){
//问题是,如果我删除这段代码,一切正常$query->where('apt_type','=',Input::get('tipo')[0]);
对于($i=1;$iorwhere('apt_type','=',Input::get('tipo')[$i]);
}
});
}
语法Input::get('tipo')[$i]
仅在PHP5.4+中可用。如果主机是PHP5.3,它将无法工作
已添加函数数组解引用,例如foo()[0]
Post
ApartmentsController@finder
类和方法的现状。问题出在您的类中。是的,我没有看到,我删除了函数查找器()内容和500错误消失了,但为什么要在本地工作?代码正在通过一个复杂的juqery生成器搜索数据库,可能有什么错误?您试图访问的URL是什么?您的Web服务器日志文件中出现了哪些行?当您访问public/index.php/finder
时会发生什么?嗨,Antonio,正如Sheikh告诉我的那样控制器方法有问题,我看不出在哪里,因为它是本地工作的。我认为这是htaccess的问题,但是如果我删除方法查找器()内容,错误500消失。我用问题代码更新了问题,为什么它是本地工作的?
$searchResult=DB::table('books')->join('apartments', 'apartment_id', '=', 'apartments.id');
if(((count($tipo)==NULL)||(count($tipo)==1)) && $tipo[0]==''){
}else if (count($tipo)==1){
$searchResult->where('apt_type','=',$tipo[0]);
}else{
$searchResult->where(function($query){
//Here is the problem, if I delete this piece of code everything works $query->where('apt_type','=',Input::get( 'tipo' )[0]);
for ($i=1;$i<count(Input::get( 'tipo' ));$i++){
$query->orwhere('apt_type','=',Input::get( 'tipo' )[$i]);
}
});
}