Install CI project though composer methed.
For example, create another applications, named “foo”, project directories like this:
/foo
/app
/public
/tests
/writable
/app
/public
/tests
/writable
/vendor
/codeigniter4/framework/system
.env
When access "foo" application, in bootstrap.php, the ROOTPATH is set as /foo.
While there is no .env file was defined under directory /foo, custom .env file was under directory /.
This caused that custum .env file under directory / could not be loaded.
The code in bootstap.php as below is unreasonable for Multiple Applications with one CodeIgniter Installation.
// The path to the project root directory. Just above APPPATH.
if (!defined('ROOTPATH')) {
define('ROOTPATH', realpath(APPPATH . '../') . DIRECTORY_SEPARATOR);
}
Install CI project though composer methed. For example, create another applications, named “foo”, project directories like this: /foo /app /public /tests /writable /app /public /tests /writable /vendor /codeigniter4/framework/system .env
When access "foo" application, in bootstrap.php, the ROOTPATH is set as /foo. While there is no .env file was defined under directory /foo, custom .env file was under directory /. This caused that custum .env file under directory / could not be loaded.
The code in bootstap.php as below is unreasonable for Multiple Applications with one CodeIgniter Installation. // The path to the project root directory. Just above APPPATH. if (!defined('ROOTPATH')) { define('ROOTPATH', realpath(APPPATH . '../') . DIRECTORY_SEPARATOR); }