서버에서 Laravel 프로젝트를 얻으려고합니다. 모든 것이 로컬에서 잘 작동하고, 서버에 모든 파일을 보내고 routes.php와 .env를 변경하여 모든 것이 작동 할 수 있도록했습니다 (데이터베이스, 쿼리, 라우트 ...).Laravel - 서버에서 요청 오류가 발생했습니다.
역방향 프록시에서 작동하지만 경로를 작동시키는 데 문제가되지 않습니다.
로그인 할 수는 있지만 데이터베이스를 사용하는 모든 항목에 액세스하거나 실행할 수 없습니다 (로그인 제외).
예 :
컨트롤러 :
public function show($id) {
$compte = Compte::find($id);
$suiviFormation = User_formation::join('formation', 'formation.id_formation', '=', 'user_formation.id_formation')
->join('type_formation', 'formation.id_type_formation', '=', 'type_formation.id_type_formation')
->where('id_compte', $id)
->where(function($query){
$query->where('formation.id_organisme', 1)
->orWhere('formation.id_organisme', Auth::user()->id_organisme);
})
->where('valide', 1)
->orderBy('type_formation.nom', 'asc')
->orderBy('formation.nom', 'asc')
->orderBy('date_formation', 'desc')
->get();
$formations = array();
$types = array();
foreach($suiviFormation as $suivi){
$formations[] = Formation::find($suivi->id_formation);
}
foreach($formations as $formation){
$types[$formation->id_type_formation] = $formation->type_formation->nom;
}
$userPoste = User_Poste::where('id_compte', $id)
->where('date_fin', null)
->first();
$formationsAvailable = Formation::select('formation.id_type_formation', 'formation.nom', 'formation_importance.importance')
->join('formation_importance', 'formation_importance.id_formation', '=', 'formation.id_formation')
->join('poste', 'poste.id_poste', '=', 'formation_importance.id_poste')
->where('formation_importance.id_poste', $userPoste->id_poste)
->where('importance', '!=', 1)
->orderBy('formation.nom', 'asc')
->groupBy('formation.id_formation')
->get();
return view('formation/formation_show', ['compte' => $compte, 'types' => $types, 'suiviFormation' => $suiviFormation,
'formations' => $formations, 'formationsAvailable' => $formationsAvailable]);
}
오류 :
QueryException in Connection.php line 624: SQLSTATE[42S02]: Base table or view not found:
1146 Table 'greement.Formation' doesn't exist
(SQL: select * from `Formation` where `Formation`.`id_formation` = 61 limit 1)
이와 같은 모든 단일 오류보세요.
데이터베이스 연결의 일부가 작동하는 것을 알면 다른 페이지가 어떻게 작동하지 않을 수 있습니까?
.env의 :
APP_ENV=local
APP_DEBUG=true
APP_KEY= appkey
DB_HOST= database.host
DB_DATABASE=greement
DB_USERNAME=user
DB_PASSWORD=*******
CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync
편집 : 서버에 직접 액세스 할 수없는, 난 단지 데이터베이스에 대한 FTP & phpMyAdmin을 사용할 수 있습니다.
서버에 직접 액세스 할 수 없으므로이를 수행 할 수 없습니다. 내가 DB를 복원하려고 시도합니다 (질문에 추가). Thanks –
.sql 파일에서 DB 날짜를 복원하면 문제가 해결되지 않았지만 여전히 동일한 오류가 발생합니다. 또한 DB에 테이블이 있습니다. 그렇지 않은 경우 웹 사이트에 로그인 할 수 없기 때문입니다. –
당신은'Formation' 테이블을 가지고 있지만 여전히 정확히 같은 에러를 내고 있다고 말하고 싶습니까? 그렇지 않다면, 테이블 이름이 Laravel이 사용하려고하는 것과 정확히 일치하는지 phpMyAdmin에서 확인하십시오. –