This example will use wget to install CodeIgniter from within the Devilbox PHP container.

After completing the below listed steps, you will have a working CodeIgniter setup ready to be served via http and https.

Table of Contents

The following configuration will be used:

It will be ready in eight simple steps:

Enter the PHP container Create a new VirtualHost directory Download CodeIgniter Symlink webroot directory Add MySQL database Configure datbase connection Setup DNS record Visit http://my-ci.loc in your browser

2. Create new vhost directory¶ The vhost directory defines the name under which your project will be available.

( <vhost dir>.TLD_SUFFIX will be the final URL ). devilbox@php-7.0.20 in /shared/httpd $ mkdir my-ci See also TLD_SUFFIX

3. Download CodeIgniter¶ Navigate into your newly created vhost directory and install CodeIgniter. devilbox@php-7.0.20 in /shared/httpd $ cd my-ci devilbox@php-7.0.20 in /shared/httpd/my-ci $ wget https://github.com/bcit-ci/CodeIgniter/archive/3.1.8.tar.gz devilbox@php-7.0.20 in /shared/httpd/my-ci $ tar xfvz 3 .1.8.tar.gz How does the directory structure look after installation: devilbox@php-7.0.20 in /shared/httpd/my-ci $ tree -L 1 . ├── 3 .1.8.tar.gz └── CodeIgniter-3.1.8 1 directory, 1 file

4. Symlink webroot¶ Symlinking the actual webroot directory to htdocs is important. The web server expects every project’s document root to be in <vhost dir>/htdocs/ . This is the path where it will serve the files. This is also the path where your frameworks entrypoint (usually index.php ) should be found. Some frameworks however provide its actual content in nested directories of unknown levels. This would be impossible to figure out by the web server, so you manually have to symlink it back to its expected path. devilbox@php-7.0.20 in /shared/httpd/my-ci $ ln -s CodeIgniter-3.1.8/ htdocs How does the directory structure look after symlinking: devilbox@php-7.0.20 in /shared/httpd/my-ci $ tree -L 1 . ├── 3 .1.8.tar.gz ├── CodeIgniter-3.1.8 └── htdocs -> CodeIgniter-3.1.8 2 directories, 1 file As you can see from the above directory structure, htdocs is available in its expected path and points to the frameworks entrypoint. Important When using Docker Toolbox, you need to explicitly allow the usage of symlinks. See below for instructions: Docker Toolbox and Symlinks