Welcome Guest, Not a member yet? Register   Sign In
Install CodeIgniter 4 on Shared Hosting
#4

Hi, I'm afraid we don't have that in the documentation as of yet. But you are in luck, I wrote it today. :-)

Shared Hosting with cPanel

cPanel is a Linux-based web hosting control panel that provides a powerful set of automation tools in an easy and
straightforward interface, allowing a simplified process for hosting websites.

The contents of CodeIgniter's public folder should be placed in your domain's Document Root, in cPanel's case it's
called public_html for your Main Domain. Here is an example of a directory structure that are created by cPanel:


Code:
/bin
/cache
/cpanelbranding
/etc
/logs
/mail
/perl
/php
/public_ftp
/public_html
/ssl
/tmp
/var


All other Default Directories should be placed in your Home Directory /home/username/ referred to as / above. But this will just turn into a mess as it's difficult to see what folder/files belong to cPanel and/or CodeIgniter.

Therefor it's recommended to create another folder named after your domain name in your home directory,
and place all other folders and files (refer to ... below) in it. This makes the final structure look like this:


Code:
/example.com
        /app
        /system
        /writable
        /tests
        ...
/public_html
        robots.txt
        index.php
        favicon.ico
        .htaccess


Since we changed the directory structure we have to tell CodeIgniter about it. Open /public_html/index.php
in a text editor and change the following line to match your domain name directory that we previously created.

PHP Code:
$pathsPath FCPATH '../example.com/app/Config/Paths.php'
Reply


Messages In This Thread
RE: Install Codeigniter 4 from archive - by jreklund - 03-28-2020, 03:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB