I have exactly the same problem.
Everything is OK at localhost, but a blank page appears on the web server.
In the log file it says "
Controller" App \ Controllers \ Home "loaded.".
I found that the problem is in the file "
system / Events / Events.php" at line 188:
PHP Code:
$ result = static :: $ simulate === false? call_user_func ($ listener, ... $ arguments): true;
The script
stops on that line and nothing else is executed after that line.
To be more precise, the problem is in the "
call_user_func" function in the "Events.php" file after the Framework runs the "
Events :: trigger ('pre_system');" at line 287 from "system / CodeIgniter.php".
This problem occurs in a "
Development" and "
Production" environment.
If you switch to the "
Testing" environment, the "Welcome" page is loaded, but with the error at the top of the page:
"Warning: Use of undefined constant SUPPORTPATH - assumed 'SUPPORTPATH' (this will throw an Error in a future version of PHP) in /home/fineshape/ci4/system/Config/AutoloadConfig.php on line 99"
My
localhost is with PHP "7.3.9" while on the
web server it is with "7.3.4".
Considering the error "call_user_func" in line 188 of the file "Events.php" you could say that the error is in the PHP version, but
why does this error not appear in the "Testing" environment?
I found where the error occurs but not the exact reason for the error to occur.
For the moment,
I fixed the error by editing the "Events.php" file as follows:
Before:
PHP Code:
$result = static::$simulate === false ? call_user_func($listener, ...$arguments) : true;
After:
PHP Code:
if($eventName == 'pre_system' && empty($arguments)){
$result = true;
}else{
$result = static::$simulate === false ? call_user_func($listener, ...$arguments) : true;
}
If anyone knows what the exact error is, please share it here.