![]() |
Hello there...
I try to setup multiple applications and I followed the instructions on http://codeigniter.com/user_guide/genera..._apps.html . The only thing I had to change was in this file: Code: mySubFolder/app/Config/Paths.php PHP Code: public $systemDirectory = __DIR__ . '/../../vendor/codeigniter4/framework/system'; PHP Code: public $systemDirectory = __DIR__ . '/../../../vendor/codeigniter4/framework/system'; Now I want to have composer-support and I change in the file: Code: mySubFolder/app/Config/Constants.php PHP Code: defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php'); PHP Code: defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . '../vendor/autoload.php'); But then I get following error: Code: Fatal error: Uncaught TypeError: Argument 1 passed to CodeIgniter\CodeIgniter::__construct() must be an instance of Config\App, null given, called in C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\Config\Services.php on line 139 and defined in C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\CodeIgniter.php:147 Stack trace: #0 C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\Config\Services.php(139): CodeIgniter\CodeIgniter->__construct(NULL) #1 C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\Config\BaseService.php(248): CodeIgniter\Config\Services::codeigniter(NULL, false) #2 C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\Config\BaseService.php(189): CodeIgniter\Config\BaseService::__callStatic('codeigniter', Array) #3 C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\Config\Services.php(134): CodeIgniter\Config\BaseService::getSharedInstance('co in C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\CodeIgniter.php on line 147 How could I fix this error ?!?
See C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\Config\Services.php on line 139
(04-12-2022, 06:21 PM)kenjis Wrote: See C:\xampp\htdocs\kighwebapps\ci4-projects\vendor\codeigniter4\framework\system\Config\Services.php on line 139 You are funny .... The line is PHP Code: return new CodeIgniter($config); but I can't find the solution for the error in my initial post above, when I fix the composer path described in the manual "Running Multiple Applications with one CodeIgniter Installation" from PHP Code: defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php'); PHP Code: defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . '../vendor/autoload.php'); Greetings... Kighlander
The error message says the $config's value is null.
Why?
(04-12-2022, 11:09 PM)kenjis Wrote: The error message says the $config's value is null. If I know why I would not ask for a solution of this problem ![]() I only want to have multiple Application with ONE ci4-installation. And I followed the instructions described in the guide. And it works fine UNTIL I wand to change the composer-part... I' using xampp local and an apache2-server online. I use virtual hosts pointed to the public-folder of each installation.
It seems the line `$config ??= config('App');` sets null to $config.
It means `config('App')` can't find Config\App.php.
(04-13-2022, 02:06 AM)kenjis Wrote: It seems the line `$config ??= config('App');` sets null to $config. I don't want to disagree with you, but this error only appears when I change the "Constants.php" file as the instructions say. If I do NOT change the file, then CodeIgniter works, but I then miss the Composer component (e.g. for addins from other developers).
Okay, the first thing you do is to check the path is correct.
ROOTPATH . '../vendor/autoload.php' Is that really correct? The instruction in the user guide is an example. If you have different folder structure, it is not correct to you.
(04-13-2022, 05:10 AM)kenjis Wrote: Okay, the first thing you do is to check the path is correct. With clean installation, the line 26 of the "Constants.php" looks like this: PHP Code: /* But if I change the path to PHP Code: ROOTPATH . '../vendor/autoload.php'); I want to install "Tatter Lightweight settings", but nothing happend. Composer said "installed" but if I followed the rest of installation the files were not there, where they should be. In this case, the guide of multiple application says that I have to modify the "Constants.php" ... and after that the app was not working with the error above...
Check the path is correct.
PHP Code: echo COMPOSER_PATH; exit; By the way, why do you want to use Multiple Applications? It seems there is no particular merit in that configuration. Just installing two appstarter is easy and simple, and it could reduce the upgrade costs. |
Welcome Guest, Not a member yet? Register Sign In |