CodeIgniter basics

Pre-Requesties

  • Download latest php from PHP Download
  • Extract the downloaded php 7.4 to your c drive and rename as php
  • Rename php.ini-development to php.ini
  • Edit php.ini
  • As per CodeIgniter document mbstring & intl extension need to be enabled with php
  • Find mbstring & intl extension text and enable it by removing ";"
  • Add php folder to your environment variable >> path
  • Download codeigniter

    Option 1 - Manual installation
  • Download CodeIgniter from https://codeigniter.com/
  • Extract downloaded CodeIgniter to your work folder
  • Open your console terminal from your workfolder
  • Open your work folder in VScode editor
  •         code .
        
    Option 2 - Using composer
  • Download and install composer fron https://getcomposer.org/download/
  • Open your workfolder in your terminal application
  • Now run
  •         composer create-project codeigniter4/appstarter project-root
        
  • Change directory to project-root and run
  •         php spark serve 
        
    Option 3 - Using Git
  • Download and install git from https://git-scm.com/downloads
  • Open your workfolder in your terminal window
  • Open https://github.com/codeigniter4/CodeIgniter4
  •         git clone https://github.com/codeigniter4/CodeIgniter4.git
        
  • Change directory to CodeIgniter4 and run
  •         php spark serve 
        
    Run the dev server Using SPARK - The Codeigniter dev server
  • To run a spark server he need to modify the system\Commands\Server file
  •         $php  = CLI::getOption('php') ?? PHP_BINARY;
    
            to 
    
            $php  = escapeshellarg(CLI::getOption('php') ?? PHP_BINARY);
        
            php spark serve 
        
  • Now visit localhost:8080
  • To stop server press control + 'C'
  • Run a dev server Using PHP built-in dev server
            php -S localhost:8000 ./public/index.php
        
  • Now visit localhost:8000
  • To stop server press control + 'C'
  • For More Watch TECHNO's Youtube channel