A list of incompatibility issues related to Codeigniter 3 using Php 8

Sessions issues

Sessions and flashdata:
system/libraries/Session/Sessions.php go to line 418 and change the code below from this:

elseif ($value < $current_time)
    unset($_SESSION[$key], $_SESSION['__ci_vars'][$key]);

to this:

elseif ($value === 'old' || $value < $current_time)
    unset($_SESSION[$key], $_SESSION['__ci_vars'][$key]);

ini_set(): Session ini settings cannot be changed

A PHP Error was encountered
Severity: Warning
Message: ini_set(): Session ini settings cannot be changed after headers have already been sent
Filename: Session/Session.php
Line Number: 282

Quick fix around ini_set()…

Open up the index.php file within the root and add ob_flush(); to the very top

Image uploader

This is not an issue with Codeigniter 3 but an issue I found in one instance within my own project. It had to do with an image format that I still cant figure out. Regardless, just make sure to exit the script if any errors with the upload:

if (!$this->upload->do_upload()) {
  $error = array('error' => $this->upload->display_errors());



Need a website, consultation or customisation? Let’s speak