AKZN Notes

Archives for My Lazy and Forgetful Mind

Codeigniter 3 with php 8.1

Last Modified on

How to

  1. update your ci 3 version to 3.1.13
  2. change config $config['sess_save_path'] = sys_get_temp_dir()
  3. add #[\ReturnTypeWillChange] before the open, read, write, close, destroy and gc functions in /system/libraries/Session/drivers/Session_files_driver.php
    example :

    #[\ReturnTypeWillChange]
    public function open($save_path, $name)
    {
    ...
  4. update system/libraries/pagination.php line 526
    from

    if ( ! ctype_digit($this->cur_page) OR ($this->use_page_numbers && (int) $this->cur_page === 0))

    to

    if ( ! ctype_digit((string) $this->cur_page) OR ($this->use_page_numbers && (int) $this->cur_page === 0))

Common error

Error on Filename: drivers/Session_files_driver.php

If you use Codeigniter's /default) file session storage driver, you need to keep in mind that it only supports absolute paths for $config['sess_save_path']

the config.php states:

|   The location to save sessions to, driver dependent.
|
|   For the 'files' driver, it's a path to a writable directory.
|   WARNING: Only absolute paths are supported!
|
|   For the 'database' driver, it's a table name.
|   Please read up the manual for the format with other session drivers.
|
|   IMPORTANT: You are REQUIRED to set a valid save path!

add below code to last line on codeigniter config

$config['sess_save_path'] = sys_get_temp_dir(); 

Source

Leave a Reply

Your email address will not be published.