Setting up a Codeigniter project

  1. Go to
    C:\xampp\htdocs
    directory
  2. Right click and open in terminal or open command line interface
  3. Run
    
    composer create-project codeigniter4/appstarter bookshop
  4. Go to
    
    C:\Windows\System32\drivers\etc\hosts
    open in text editor (with admin rights)
  5. Add
    
    127.0.0.1 bookshop.local
    and save
  6. Go to
    
    C:\xampp\apache\conf\extras\httpd-vhosts.conf
    open in text editor (with admin rights)
  7. Add
    
    <VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/bookshop"
    ServerName bookshop.local
    <Directory "C:/xampp/htdocs/bookshop">
              Require all granted
            AllowOverride All
        </Directory>
    </VirtualHost>
    Or
    
      	<VirtualHost *:80>
        	DocumentRoot "C:/xampp/htdocs/bookshop/public"
        	ServerName bookshop.local
    	</VirtualHost>
      
  8. Restart Xampp if needed
  9. Go to project folder
    C:\xampp\htdocs\bookshop
  10. Open env file
    1. Change production to development
      # ENVIRONMENT
      #--------------------------------------------------------------------
      
       CI_ENVIRONMENT = development
    2. Change base url
      
      app.baseURL = 'http://bookshop.local/'
    3. Save and close the file. Then rename it as .env
  11. Remove Public and index.php from URL
    1. Open App.php File from the Location c:\xampp\htdocs\bookshop\app\Config\App.php
    2. Change from
      
      public @baseURL = 'http://localhost:8080';
      to
      
      public @baseURL = 'http://bookshop.local';
    3. Change from
      
      public $uriProtocol = 'REQUEST_URI';
      to
      
      public $uriProtocol = 'PATH_INFO';
    4. In public directory, move index.php and .htaccess file to the root project folder.
    5. Open index.php from project root directory, and edit the following path: from
      
      $pathsPath = FCPATH.'../app/Config/Paths.php';
      to
      
      $pathsPath = FCPATH.'app/Config/Paths.php';

Popular posts from this blog

Evolution of computers and Computers today

Convert into binary

Processor Types and Specifications