Bagaimana cara mengatasi error saat proses hosting di codeigniter ?

An uncaught Exception was encountered

Type: RuntimeException

Message: Unable to locate the model you have specified: Model_barang

Filename: /home/vol15_6/epizy.com/epiz_27525911/htdocs/system/core/Loader.php

Line Number: 348

Backtrace:

File: /home/vol15_6/epizy.com/epiz_27525911/htdocs/index.php

Line: 315

Function: require_once

avatar laurentellyzabeth
@laurentellyzabeth

14 Kontribusi 0 Poin

Diperbarui 3 tahun yang lalu

4 Jawaban:

<div>Biasanya di hosting itu menggunakan OS Linux, dan Linux itu bersifat Case-Sensitive, coba cek penamaan file dan penamaan Class-nya, apkaah sudah sama atau belum.<br><br>Misalkan gini, saya punya class seperti ini :</div><pre><em>&lt;?php defined</em>('BASEPATH') <em>or exit</em>('No direct script access allowed');

<em>class </em>Dosen <em>extends </em>CI_Controller {

<em>public function </em>__construct() { <em>parent</em>::<em>__construct</em>();

  &lt;em&gt;if &lt;/em&gt;(!isAuthenticated()) {
     redirect(&#039;login&#039;);
  }

}</pre><div><br>Maka, nama file-nya usahakan "Dosen", bukan "dosen" (dengan ekstensi file .php). Ini masalah sederhana, biasanya orang yang develop pakai Windows ngga sadar ini, karena di Windows itu sifatnya non Case-Sensitive, sehingga huruf kapital dan huruf kecil dianggap sama, sedangkan berbeda dengan Linux yang bersifat Case-Sensitive.<br><br>Semoga membantu.</div>

avatar ahanafi
@ahanafi

815 Kontribusi 552 Poin

Dipost 3 tahun yang lalu

<div><figure data-trix-attachment="{&quot;contentType&quot;:&quot;image/jpeg&quot;,&quot;filename&quot;:&quot;error2.JPG&quot;,&quot;filesize&quot;:31269,&quot;height&quot;:239,&quot;url&quot;:&quot;https://i.ibb.co/KNsQTHb/error2.jpg&quot;,&quot;width&quot;:586}" data-trix-content-type="image/jpeg" data-trix-attributes="{&quot;presentation&quot;:&quot;gallery&quot;}" class="attachment attachment--preview attachment--jpg"><img src="https://i.ibb.co/KNsQTHb/error2.jpg" width="586" height="239"><figcaption class="attachment__caption"><span class="attachment__name">error2.JPG</span></figcaption></figure> di class Model_barang ini kah yang harus diubah ?&nbsp;<br><br></div>

avatar laurentellyzabeth
@laurentellyzabeth

14 Kontribusi 0 Poin

Dipost 3 tahun yang lalu

Tanggapan

coba cek penamaan file modelnya, apakah namanya "Model_barang.php" atau "model_barang.php", intinya harus persis sama dengan nama class-nya.

<div>sudah bisa ,terimakasih banyak ya gan tapi saya ada kendala lagi nih..<br>terdapat pesan 404 page not found saat membuka keranjang <br>pada file keranjang.php <br>ini solusinya bagaimana ya?<br><figure data-trix-attachment="{&quot;contentType&quot;:&quot;image/jpeg&quot;,&quot;filename&quot;:&quot;keranjang.JPG&quot;,&quot;filesize&quot;:29419,&quot;height&quot;:266,&quot;url&quot;:&quot;https://i.ibb.co/w773hJx/keranjang.jpg&quot;,&quot;width&quot;:612}" data-trix-content-type="image/jpeg" data-trix-attributes="{&quot;presentation&quot;:&quot;gallery&quot;}" class="attachment attachment--preview attachment--jpg"><img src="https://i.ibb.co/w773hJx/keranjang.jpg" width="612" height="266"><figcaption class="attachment__caption"><span class="attachment__name">keranjang.JPG</span></figcaption></figure></div>

avatar laurentellyzabeth
@laurentellyzabeth

14 Kontribusi 0 Poin

Dipost 3 tahun yang lalu

<div>apakah melakukan hal sama yaitu dengan mengganti nama filenya lagi?</div>

avatar laurentellyzabeth
@laurentellyzabeth

14 Kontribusi 0 Poin

Dipost 3 tahun yang lalu

Tanggapan

Tergantung error' nya seperti apa, coba buat Thread baru, karena case ini sudah dianggap selesai

Login untuk ikut Jawaban