![]() |
Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 (/showthread.php?tid=89085) |
Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 - adimancifi - 01-04-2024 I have problem here, when I run PHP 8.3 the error view like this : ![]() File : vendor\codeigniter4\framework\system\Debug\BaseExceptionHandler.php Line : 185 PHP Code: if ( version_compare(PHP_VERSION, '8.3.0', '<') ) { I update the code like that and works to PHP 7 or PHP 8.3. So, why like that ? RE: Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 - demyr - 01-04-2024 Probably a bug. Same error here. And also it displays this error page only when I set display_errors to 1, not in development.php but interestingly in production.php under app/Config/Boot/. Otherwise I get the Whoops! page. I can't see the error page (even though my .env is set to development). Additionally, in the error page it detects the environment as production, not development. RE: Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 - davis.lasis - 01-05-2024 Same here. CodeIgniter 4.4.4 PHP 8.3.1 ErrorException has empty <pre><code></code></pre> Although i have no issues with dev or prod mode. Not sure whats about attaching images, bet there is direct link https://ibb.co/fnPD6Kp So, i did some tests and debugging. I found out that empty code appears in PHP 8.1 as well. Maybe something related to apache, as yesterday i changed my Laragon setup - apache - http-2.4.54 to http-2.5.8 - php - 8.1 to 8.3.1 Quick system fix is to disable 2 lines /system/Debug/BaseExceptionHandler.php line 185 //$source = str_replace('<br />', "\n", $source[1]); line 186 //$source = explode("\n", $source); With those commented out errors shows as intended I havent dig entirely through, and because of lack of time, i am not ready to provide pull request or a proper fix at this moment https://ibb.co/j4ybfBm RE: Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 - adimancifi - 01-07-2024 yes, line 185 and 186. I disabled it before, but when I back to PHP 7 or 8.1 it become empty again because PHP versions lower than 8.3.0 require those two lines of code. So, I check the PHP version first before I disable that lines, like this : PHP Code: if ( version_compare(PHP_VERSION, '8.3.0', '<') ) { Aafter I change the code in BaseExceptionHandler.php and I update codeigniter using composer it will be back to original again. RE: Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 - kenjis - 01-07-2024 This bug has been fixed in develop branch. https://github.com/codeigniter4/CodeIgniter4/pull/8401 And will be fixed in v4.4.5. RE: Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 - adimancifi - 01-07-2024 (01-07-2024, 07:40 PM)kenjis Wrote: This bug has been fixed in develop branch. Great job. so, when can we download version 4.4.5? ![]() RE: Error view exception is not showing the source code in PHP8.3 - Codeigniter v4.4.4 - kenjis - 01-07-2024 We do not have time-based release. So nobody can't say when. But you can see the past release dates. https://github.com/codeigniter4/CodeIgniter4/blob/develop/CHANGELOG.md |