我總是得到內部服務器錯誤,我正在尋找解決方案,但無法獲得解決我的問題的最佳解決方案。 我該如何解決這個問題? 內部服務器錯誤500 她是我的代碼在laravel 5.1上使用此代碼獲取內部服務器錯誤500
路由器:
Route::get('getdata', function()
{
$term = Str::lower(Input::get('term'));
$data = array(
'R' => 'Red',
'O' => 'Orange',
'Y' => 'Yellow',
'G' => 'Green',
'B' => 'Blue',
'I' => 'Indigo',
'V' => 'Violet',
);
$return_array = array();
foreach ($data as $k => $v) {
if (strpos(Str::lower($v), $term) !== FALSE) {
$return_array[] = array('value' => $v, 'id' =>$k);
}
}
return Response::json($return_array);
});
我的刀鋒:
<?= Form::open() ?>
<?= Form::label('auto', 'Find a color: ') ?>
<?= Form::text('auto', '', array('id' => 'auto'))?>
<br>
<?= Form::label('response', 'Our color key: ') ?>
<?= Form::text('response', '', array('id' =>'response', 'disabled' => 'disabled')) ?>
<?= Form::close() ?>
<script type="text/javascript">
$(function() {
$("#auto").autocomplete({
source: "getdata",
minLength: 1,
select: function(event, ui) {
$('#response').val(ui.item.id);
}
});
});
</script>
你能檢查你的錯誤日誌以獲得關於錯誤的更多細節嗎? –
是的,檢查你的Laravel日誌,看它是否給出了錯誤的更多細節,否則你的服務器日誌可能會給你更多的信息。 – James
這是我的日誌 [2015-11-23 04:29:14] local.ERROR:異常'Symfony \ Component \ Debug \ Exception \ FatalErrorException'消息'Class'Str'not found'in D:\ go (輸入:: get('term')); //輸入:: get('term')); //輸入:get('term'); –