Amazon Best Products with minimum price

Tuesday 3 October 2017

CodeIgniter 4 Configuration and Installation (Tutorial Part 1)

Welcome to CodeIgniter 4:

CodeIgniter Comes in three flavors: CodeIgniter 3 (Current), CodeIgniter 4 (Future) and CodeIgniter 2 (Legacy)

CodeIgniter is a lightweight Framework (Released in 2006). CodeIgniter is very easy to install, within half an hour you can run your program by CodeIgniter. It works nicely on almost all Shared and Dedicated hosting Platforms.Currently required PHP version is 5.2.4.


Server Requirements:

PHP version 7.0.15 or newer is required, with intl extension installed.

Database is required in almost all web application, for the CI4 the database requirement is:

  • MySQL(5.1+) via the MySQLi driver
  • PostgreSQL via the Postgre driver
Installation:

There are two ways to install CI4 : Manually and Composer

1) Manual Installation:

You can download the file from the official website of Codeigniter, please click HERE to download the CI4 file.

2) Composer Installation:

Now CI can be installed via Composer create-project command.

composer create-project codeigniter4/framework

Running: 

1) Upload the unzip file to your local machine or server. In CI4 , the index.php file will be in public folder inside project root.

The Big Change to the previous version is that there is now a public directory, for the security related reason it is necessary for separation of application/Framework and public (JS, CSS, Images etc). The document root will no longer be placed in the root directory of CodeIgniter, but Now in the public Folder.

2)  For setting the base URL, session , encryption key etc you will need to open the App.php file for configuration.

Open the application/Config/App.php file with any text editor and set your base URL.

3) For the setting database Configuration, open the application/Config/Database.php with any text Editor and set your database setting.

For the security reason, both the system and any application can be placed above the web root so that they are not directly accessible via any browser.

If anyone wants to keep there view file public, it is also possible in CI4 via move the view directory from application directory to corresponding folder inside the public directory. After this you need to open your main index.php file and set the $system_path, $application_folder and $view_folder variables preferably full path (eg: /www/domain/system).

Stay tuned to learn how CI4 works in my next blog...

Thank you

1 comment:

  1. Hi
    looks like that in late 2017 you expired the time for write articles in this super-interesting blog.

    Hope u r fine :-)

    Do you now have your own website?

    It would be interesting to read part two of this tutorial and followups

    Thank you

    ReplyDelete