Mengatasi Error Message Fopen Failed Codeignitier



Masalah ini muncul saat admin melakukan upload data aplikasi ke cpanel. Muncul permasalahan yang kami anggap baru. saat konfigurasi database selesai, muncul error:

A PHP Error was encountered
Severity: Warning
Message: mkdir(): Invalid path
Filename: drivers/Session_files_driver.php
Line Number: 117
Backtrace:
File: /usr/share/nginx/html/ci/index.php
Line: 292
Function: require_once

An uncaught Exception was encountered
Type: Exception
Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created.
Filename: /usr/share/nginx/html/ci/system/libraries/Session/drivers/Session_files_driver.php
Line Number: 119
Backtrace:
File: /usr/share/nginx/html/ci/index.php
Line: 292
Function: require_once


A PHP Error was encountered
Severity: Warning
Message: fopen(ea936f6cca00382143f867cea8043f45d9b818c2): failed to open stream: Permission denied
Filename: drivers/Session_files_driver.php
Line Number: 156
Backtrace:

Server yang digunakan yaitu PHP 7.3.11 dan framework codeignitier terbaru yaitu 3.1.11

Untuk cara mengatasinya cukup merubah pada file config.php dan ubah baris berikut:

$config['sess_save_path'] = NULL;

Ganti menjadi :

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