run codeigniter 4 with spark

To run CodeIgniter 4 with Spark, follow these steps:

  1. Install Composer: Composer is a dependency management tool for PHP. Download and install Composer on your system.

  2. Create a new CodeIgniter project: Open your command prompt or terminal and navigate to the directory where you want to create your CodeIgniter project. Run the following command to create a new project:

composer create-project codeigniter4/appstarter project-name

Replace "project-name" with the desired name for your project.

  1. Install Spark: Spark is the command-line tool provided by CodeIgniter to manage your project. In the command prompt or terminal, navigate to your project's directory and run the following command to install Spark:

php spark

  1. Generate the key: Run the following command to generate a secure key for your application:

php spark key:generate

This key is used for encrypting cookies and other sensitive data in your application.

  1. Start the development server: Run the following command to start the built-in development server:

php spark serve

This will start the server on http://localhost:8080 by default.

  1. Access your application: Open your web browser and navigate to http://localhost:8080. You should see the CodeIgniter 4 welcome page, indicating that your application is running successfully.

  2. Customize your application: You can now start building your application by adding controllers, models, views, and routes according to your requirements.

That's it! You have successfully set up and started a CodeIgniter 4 project with Spark.