Skip to content

Mobile API Login : Uncaught Error: Non-static method HTTP_Session::_init() cannot be called statically

When calling Mobile API login operation, there is an error in PHP8.x

<br /> <b>Fatal error</b>: Uncaught Error: Non-static method HTTP_Session::_init() cannot be called statically in /var/www/html/cahmcrm/libraries/HTTP_Session/Session.php:803 Stack trace: #0 /var/www/html/cahmcrm/modules/Mobile/api/Session.php(10): include_once() #1 /var/www/html/cahmcrm/modules/Mobile/api.php(35): include_once('...') #2 {main} thrown in <b>/var/www/html/cahmcrm/libraries/HTTP_Session/Session.php</b> on line <b>803</b><br />

This can be solved by changing init() function to static

static function _init()

I assume there are more places non

Edited by sutharsan