In this guide, we will walk through the steps to create a default installation of CodeIgniter 4.5.5 using Composer on a WAMP server. The installation will be set up in a subfolder named “test”. This process will ensure that you have a functional CodeIgniter environment ready for development. You don’t have to use “test”. You can name it whatever you want.
Getting Started:
- Install Composer (if not already installed):
- Download Composer from getcomposer.org.
- Follow the installation instructions for Windows.
- Open Command Prompt:
- Navigate to the WAMP server’s
www
directory. This is typically located atC:\wamp64\www
.
- Navigate to the WAMP server’s
cd C:\wamp64\www
3. Create the Subfolder:
- Create a new directory named “test”.
mkdir test
4. Install CodeIgniter:
- Use Composer to create a new CodeIgniter project in the “test” directory.
composer create-project codeigniter4/appstarter test
5. Set Up Virtual Host (optional but recommended):
- Open the WAMP server’s
httpd-vhosts.conf
file, usually located atC:\wamp64\bin\apache\apache2.x.x\conf\extra\httpd-vhosts.conf
. - Add the following configuration:
<VirtualHost *:80>
DocumentRoot "C:/wamp64/www/test/public"
ServerName test.local
<Directory "C:/wamp64/www/test/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
6.Update Hosts File:
- Edit the
C:\Windows\System32\drivers\etc\hosts
file and add the following line:
127.0.0.1 test.local
Steps Taken
- Composer Installation: Composer is a dependency manager for PHP, which simplifies the process of managing libraries and packages. By installing Composer, you ensure that you can easily manage CodeIgniter and its dependencies.
- Command Prompt Navigation: By navigating to the
www
directory, you are setting the context for where your web applications will reside. This is crucial for WAMP to serve your application correctly. - Creating the Subfolder: The
mkdir
command creates a new directory named “test” where the CodeIgniter application will be installed. This helps in organizing your projects. - Installing CodeIgniter: The
composer create-project
command initializes a new CodeIgniter project in the specified directory. This command downloads the latest version of CodeIgniter and sets up the necessary file structure. - Setting Up Virtual Host: Configuring a virtual host allows you to access your application using a custom domain (e.g.,
test.local
) instead oflocalhost/test
. This makes development easier and more organized. - Updating Hosts File: By adding an entry to the hosts file, you are mapping the custom domain to your local server. This step is essential for the virtual host to work correctly.
- Restarting WAMP Server: Restarting the server applies all configuration changes, ensuring that your new virtual host is recognized and accessible.
By following these steps, you will have a fully functional CodeIgniter installation in a subfolder named “test” on your WAMP server, ready for development.
I’ve been designing web applications—on and off—since 2001, back when animated GIFs were all the rage and ‘responsive design’ meant answering your client’s emails. Over the past 14 years, I’ve kept pace with the ever-evolving trends in PHP development, successfully delivering a variety of projects that made my clients happy (and kept me caffeinated).
This website serves as my soapbox—a place to share the insights I’ve picked up along the way with anyone curious enough to dive in. Welcome aboard!
Need some custom work done? Or, just want to reach out? Email: dan@danoriordan.com