panormitis Posted July 12, 2022 Report Posted July 12, 2022 Technically I guess it's not really a bug, but since a disabled function in PHP 8.1 becomes pretty much non existent, it raises a fatal error and prevents Blesta from working. So I commented out line 78 of the file ...vendors/minphp/session/src/Session.php and added another bellow it. // ini_set('session.' . $key, $value); if (function_exists('ini_set')) { ini_set('session.' . $key, $value); } Quote
steven99 Posted July 13, 2022 Report Posted July 13, 2022 That would be the case in other versions of PHP if ini_set is in the disabled_functions list, correct? (though disabling that function would break a ton of other scripts like Wordpress) Good defensive coding doesn't hurt though. Quote
panormitis Posted July 13, 2022 Author Report Posted July 13, 2022 2 hours ago, steven99 said: That would be the case in other versions of PHP if ini_set is in the disabled_functions list, correct? (though disabling that function would break a ton of other scripts like Wordpress) Good defensive coding doesn't hurt though. On PHP 8.0/8.1 disabled functions are treated as nonexistent so a fatal error occurs. On earlier PHP versions, disabled functions raise just a warning and the script continues to work. I believe this should be addressed in Blesta, some functions could be disabled so they should be checked with function_exists() first. Quote
Paul Posted July 13, 2022 Report Posted July 13, 2022 ini_set is called throughout Blesta and in vendor code for legitimate reasons. In your case, /vendors/minphp/session/src/Session.php ini_set is used to set session variables. As far as I know, this has not changed recently, so it may be that a change to PHP 8 is responsible. We would probably recommend not disabling ini_set, but @Jono may be able to take a look when he has some time. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.