Running CodeIgniter Project

Running CodeIgniter Project

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

Deploying a CodeIgniter Project to MAMP

Migrating from a standalone installation of CodeIgniter to an actual project directory often trips up developers who are new to PHP frameworks. You have successfully installed the framework itself and verified it works via the default index.php in your local folder, but you're unsure how to integrate your existing web site project into this environment. The confusion usually stems from a misunderstanding of how CodeIgniter's autoloading mechanism interacts with file paths.

To run your entire project, you don't necessarily need to "install" the framework inside your project folder, although that is one valid approach. A more common and flexible pattern for local development involves setting up two distinct directories on MAMP: one containing the CodeIgniter core files (the library) and another containing your application code. The critical step is ensuring the application folder within your project points to the correct location of the framework's core files.

If you are following the standard directory structure provided by the CodeIgniter installation, your local setup likely looks like this:

  • /Applications/MAMP/www/codeigniter/ (The framework core)
  • /path/to/your/project/application/ (Your project source)

You must configure your index.php file to point to the correct base path. In older versions of CodeIgniter, the default configuration assumed a specific folder structure where system/core/index.php was loaded automatically. However, if you are moving a whole website project into MAMP, you need to ensure that your application/config/config.php or your main entry file correctly resolves the paths to the bootstrap, core, and library folders of the framework.

A frequent mistake is assuming that simply copying the project files into htdocs will make it work out of the box. If your project relies on a separate installation of the CodeIgniter library, you must update the base path in your configuration. For instance, if your main index.php resides at /Applications/MAMP/www/my-project/index.php, and your framework core is located at /Applications/MAMP/www/codeigniter/, you may need to adjust the $base_url and $system_path variables to reflect these locations.

Another viable strategy, which many developers prefer for local development, is to place the CodeIgniter framework directly inside your project root. In this scenario, your directory structure would be:

  • /Applications/MAMP/www/my-project/system/
  • /Applications/MAMP/www/my-project/application/
  • /Applications/MAMP/www/my-project/index.php

This approach eliminates the need to configure complex path mappings because the framework is physically located where the application expects it. When you run php artisan serve (if using a newer version) or simply access your domain in the browser, CodeIgniter will locate its own files relative to the index.php entry point without issue.

If you are using a CMS specifically built on CodeIgniter, ensure that your .htaccess file is correctly configured to route all requests through the index.php file. This is crucial because PHP's default behavior might attempt to execute specific resource files directly if they are not routed through the framework's front controller. Without proper routing, you may encounter "File not found" errors or 500 Internal Server Errors when trying to access views or controllers.

Remember that MAMP runs on port 8888 by default unless you have changed it in your settings. Your project URL should reflect this: http://localhost:8888/my-project. If you are using a specific subdomain for development, ensure that your hosts file is updated accordingly, although this is less common for local-only projects.

If you encounter persistent issues regarding path resolution, check the error logs in MAMP's console or within your project's system/logs directory. These logs will often reveal whether the framework is failing to load its core libraries due to a mismatched base path configuration. By aligning your file structure with the framework's expectations, you can seamlessly transition from a standalone test environment to running your full CodeIgniter-based website locally.

Our network