It seems my model isn’t detected. I’m trying to upload my codeigniter site to the web hosting service but I have a problem in my model, it shows this error:
An uncaught Exception was encountered Type: RuntimeException
Message: Unable to locate the model you have specified: User_model
Filename:
/home/u661467832/domains/pp-quarry.com/public_html/system/core/Loader.phpLine Number: 350
Backtrace:
File:
/home/u661467832/domains/pp-quarry.com/public_html/application/controllers/Absensi.php
Line: 7 Function: __constructFile: /home/u661467832/domains/pp-quarry.com/public_html/index.php
Line: 315 Function: require_once
2
When deploying a CodeIgniter application to a web hosting service, it’s important to correctly configure the file structure to ensure that the application functions properly.
Move index.php to public_html:
- Place the index.php file inside the public_html directory. This directory is the entry point for the public-facing part of your application.
Move Other Directories Outside public_html:
- Move the application/, system/, and vendor/ (if using Composer) directories outside of public_html. This ensures that sensitive application files are not directly accessible from the web.
Sample structure,
/home/user/
│
├── application/ // Application files (outside public_html)
├── system/ // System files (outside public_html)
├── public_html/ // Publicly accessible directory
│ └── index.php // Entry point of the application
│ └── assets/ // Static files (CSS, JS, images, etc.)
Try this way and hope this resolves the issue.
2