How to install CodeIgniter on Ubuntu 18.04?

0
215
CodeIgniter

Nowadays many developers prefer the web to make their applications. Some choose Python and Django, others Ruby on Rails, but others prefer CodeIgniter and PHP. Today, I’ll show you how to install CodeIgniter on Ubuntu 18.04.

CodeIgniter is a PHP framework for web development with a focus on process simplicity. It is based on object-oriented programming but does not force you to use it, which makes it a quite versatile framework. On the other hand, CodeIgniter stands out for using many conventions so you won’t have to configure practically anything. All this without sparing efforts to be a very safe framework.

So let’s install CodeIgniter on Ubuntu 18.04.

1. Install Apache web server

The first step is to install a web server where you can run CodeIgniter. There are several, such as Nginx or Lighttpd, however, I will choose Apache web server.

Open a terminal and run:

1.- Installing Apache web server
1.- Installing Apache web server

Next, make Apache starts at the system boot. Then, start the service.

2.- Working with apache service
2.- Working with apache service

If you want to check that everything is OK, open your web browser and go to http://IP_SERVER and you should see this.

3.- Apache default page
3.- Apache default page

Nice. Apache web server is ready.

2. Install PHP

CodeIgniter is a PHP framework, so obviously you have to install PHP.

4.- Install PHP
4.- Install PHP

In order to check if PHP is working correctly, create a file called test.php in /var/www/html.

And add the following:

5.- Testing the PHP installation
5.- Testing the PHP installation

Finally, open it from your web browser. . http://IP_SERVER/test.php

6.- PHP info
6.- PHP info

PHP is correctly installed.

3. Install MariaDB

So, the next step to install CodeIgniter on Ubuntu 18.04 is to install MariaDB. MariaDB is a database manager derived from MySQL.

7.- Install MariaDB
7.- Install MariaDB

It is time to set a root password for MariaDB. You can do it using the mysql_secure_installation script.

Not only will you be able to define the password, but you will also be asked other questions about setting up MariaDB. I answered: Y, N, Y, Y.

8.- Using mysql_scure_installation script to configure MariaDB
8.- Using mysql_scure_installation script to configure MariaDB

Next, enable and start the MariaDB service.

9.- Starting the MariaDB service
9.- Starting the MariaDB service

4. Install CodeIgniter

It’s time to install CodeIgniter. Do it.

10.- Download and install CodeIgniter
10.- Download and install CodeIgniter

Next, decompress it.

11.- Decompressing the file
11.- Decompressing the file

Rename the folder:

Finally, change the permissions.

12.- Setting the permissions
12.- Setting the permissions

To configure CodeIgniter with your MariaDB database you must modify the application/config/config.php file and add your credentials.

13.- Set your database credentials
13.- Set your database credentials

Finally, open your web browser and go to http://IP_SERVER/codeigniter

14.- Codeigniter default page
14.- Codeigniter default page

And that’s it.

Conclusion

CodeIgniter is a great framework for web development with PHP. It is versatile, powerful and its installation is within everyone’s reach.

Please share this post with your friends.

 

Spread the love
  • 7
    Shares

PS. If you like this post please share it with your friends on the social networks using the buttons above.Thanks.

LEAVE A REPLY

Please enter your comment!
Please enter your name here