To set up the project on cPanel, follow these instructions:
Running the Project Locally:
- Ensure you have XAMPP installed and running. Start XAMPP if it's not already running.
- Move the project folder to the
htdocsfolder of your XAMPP installation. - Open your web browser and enter the following URL to run the project locally:
http://127.0.0.1/project-folder-name/. - In the project folder, locate the
config.phpfile. Replacedefine('BASE_URL', 'http://127.0.0.1/shamba/');withdefine('BASE_URL', 'http://127.0.0.1/project-folder/');. - Look for the
getActiveRecordIdfunction in most of the files (usually at the bottom, e.g., in the footer). Replacevar url = 'http://127.0.0.1/shamba/';withvar url = 'http://127.0.0.1/folder-name/';. Keep the rest of the URL content unchanged.
Running the Project on a Server (cPanel):
- Upload the project folder to your web server using FTP or cPanel's file manager.
- In the project folder, locate the
config.phpfile. Replacedefine('BASE_URL', 'http://127.0.0.1/shamba/');withdefine('BASE_URL', 'domain name');. - Look for the
getActiveRecordIdfunction in most of the files (usually at the bottom, e.g., in the footer). Replacevar url = 'http://127.0.0.1/shamba/';withvar url = 'domain name';. Keep the rest of the URL content unchanged.
Database Connection:
-
Navigate to the
project-folder/database/Database.phpfile. -
Update the database connection settings based on your cPanel configuration. Modify the following lines:
$this -> db_host = "127.0.0.1"; // Replace with your database host. $this -> db_user = ""; // Replace with your database username. $this -> db_password = ""; // Replace with your database password. $this -> db_name = ""; // Replace with your database name.
Fill in the appropriate values for your cPanel-hosted database.
These instructions should help you set up and run your project on cPanel. Make sure to replace the placeholders with your actual domain name, database credentials, and project folder names as needed.