Close

🔰 PHP Programming Tutorial 1 - php codeigniter4 configuration in xampp or wamp 🔰


CodeIgniter 4 requires PHP version 7.2 or higher. The earlier version requires a minimum PHP 5.3 version or higher.

There is now a public directory like in other frameworks. You can now separate the application from the resources (like CSS, JS, files.).

It is much more difficult for attackers.

In this tutorial, I show how you can install/configure the Codeigniter 4 project on Windows and Mac.


Contents

  1. Download Software
  2. XAMPP Installation
  3. Configure php.ini
  4. Configure Codeigniter
  5. Cofigure Using composer
  6. Conclusion

1. Download Software

  • Download Sublime Text 4 zip file from here .
  • Download XAMPP (Windows 64 bit and PHP 7.3.29) zip file from here .
  • Download CodeIgniter 4 zip file from here .
  •  

    Unzip sublime-* and install.

    Unzip XAMPP-* and install.

    Unzip Codeigniter-* & copy the folder to D(your drive):\xampp\htdocs\ and Rename the folder (e.g. codeigniter4).


2. XAMPP Installation

  • Right click on XAMPP-*.exe and start installation.
  •  

  • Click "Ok" for User Account Control permission.
  •  

  • Click on "Next"
  •  

  • Here you can choose what are the server/Program Languages, you want to select then Click on "Next"
  •  

  • Choose a folder to install XAMPP. Then Click on "Next".
  •  

  • Choose Language. Then Click on "Next".
  •  

  • After successfull installation, control panel will be look like below image. Here issue with the default port 80 for apache Server. Next step we will solve the problem of Port 80 Issue.
  •  

  • If any issue related to port then only flow the steps related to port number change Otherwise directly leave the default port as 80. Click on Config button(refer below image). Then click on Apache(httpd.conf) then Click. Or you can open from the folder path also.
  •  

  • Open in any Text editor like Notepad, Notepad ++, Sublime etc. Then search for Listen 80.
  •  

  • Change Port number 80 to Port 90 (see in below image)
  •  

  • Now click on Start button. And the running XAMPP Control Panel will be look like below image.
  •  

  • Test the localhost is woking or not. Open browser then enter localhost:90
  •  


3. Configure php.ini

  • Open php.ini file to enable intl and mbstring extension.
  • Search extension in the php.ini file.
  •  

extension=intl.dll
extension=mbstring.dll

OR

extension=php_intl.dll
extension=php_mbstring.dll
  • Remove semicolon (;) if exists to enable the extension.
  • Restart the Apache web server.

4. Cofigure Codeigniter

  • Copy Codeigniter-* folder to D(your drive):\xampp\htdocs\ and Rename the folder (e.g. codeigniter4).
  •  

  • Rename Codeigniter-* to Codeigniter4 (or name in your choice)
  • After rename the folder.
  •  

  • Open in Browser http://localhost:90/Codeigniter4 or if you are running with default port 80 then http://localhost/Codeigniter4. Output should be look like below image.
  •  

  • In browser output.. Click on "Public" folder. The below output will come.
  •  

  • If you want to remove "public" foldername from url then create a index.php page inside the "Codeigniter4" folder then download the code index.txt file, open in notepad and paste the code into index.php(This file should be inside the "Codeigniter4").
  •  


5. Cofigure Using composer

  • Navigate to htdocs/ using Command Prompt if you are on Windows and use the terminal if you are on Mac.
  • Run the following command –
composer create -project codeigniter4/appstarter project - root
				
  • If Setup Install Mode will apear then install as below process.
  •  

  • Installation Options
  •  

  • Browse php from your folder like D:\xampp\php\php.exe
  •  

  • Click on Next
  •  

  • Ready.. Click on "Install" button.
  •  

  • Click on "Next" button.
  •  

  • Yooo... Click on "Finish" button.
  •  

  • Open cmd.exe or Command Line. Then Run the below Code.
  • composer create -project codeigniter4/appstarter project - root

     

  • Folder Codeigniter4 will be created in given path.
  •  

  • Open in Browser by entering the url to address bar.
    http://localhost/codeigniter4/public/
    • Replace project-root with your project name like – codeigniter4
    • If you are getting the following message on the Command prompt while running –

    • It means intl extension is not been enabled.
    • To enable the extension follow the step 1 .
    • Re-run the composer create-project codeigniter4/appstarter project-root .
    • A new codeigniter4 folder will be created.

    6. Conclusion

    You can either install it using a composer or manually. Before installing make sure that the PHP version is 7.2 or higher.



    😉Subscribe and like for more videos:
    https://www.youtube.com/@chiragstutorial
    💛Don't forget to, 💘Follow, 💝Like, 💖Share 💙&, Comment

    0 Comments
    Leave a message

     

    Search Current Affairs by date
    Other Category List

    Cookies Consent

    We use cookies to enhance your browsing experience and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Cookies Policy