Welcome Guest, Not a member yet? Register   Sign In
CI 3.1.13 Unable to locate the specified class: Session.php
#1

(This post was last modified: 09-18-2024, 02:05 AM by Smekke.)

So I've inherited an old CI 3 project running on PHP7.0

I've upgrade to the latest CI 3 version and I want to make the change to PHP7.4 so that I can keep upgrading to CI 4, then upgrade to PHP8 etc.

95% of the site works fine but on some pages, I just get a blank page saying "Unable to locate the specified class: Session.php"


These are my autoloaded libraries:

Code:
$autoload['libraries'] = array('database','session','lib_smarty','module','form','tank_auth','user_auth');


I've looked through the forum for topics with a similar problem but most were either unresolved and/or their solution didn't work for me.
I've already installed a fresh copy of CI 3.1.13.

If I remove all libraries from the autoload, I am greeted with the following error.

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Module::$session

Filename: core/Model.php

Line Number: 74
Reply
#2

(09-18-2024, 02:05 AM)Smekke Wrote: So I've inherited an old CI 3 project running on PHP7.0

I've upgrade to the latest CI 3 version and I want to make the change to PHP7.4 so that I can keep upgrading to CI 4, then upgrade to PHP8 etc.

95% of the site works fine but on some pages, I just get a blank page saying "Unable to locate the specified class: Session.php"


These are my autoloaded libraries:

Code:
$autoload['libraries'] = array('database','session','lib_smarty','module','form','tank_auth','user_auth');


I've looked through the forum for topics with a similar problem but most were either unresolved and/or their solution didn't work for me.
I've already installed a fresh copy of CI 3.1.13.

If I remove all libraries from the autoload, I am greeted with the following error.

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Module::$session

Filename: core/Model.php

Line Number: 74

I don't know which version you started migrating from but the session library was completely rewritten. Did you follow the steps shown here? https://codeigniter.com/userguide3/insta...ading.html
Reply
#3

I turned on all logging and when loading one of the pages that has the issue, this is the log.

Code:
INFO - 2024-09-18 18:13:12 --> Config Class Initialized
INFO - 2024-09-18 18:13:12 --> Hooks Class Initialized
DEBUG - 2024-09-18 18:13:12 --> Accessing maintenance hook!
DEBUG - 2024-09-18 18:13:12 --> UTF-8 Support Enabled
INFO - 2024-09-18 18:13:12 --> Utf8 Class Initialized
INFO - 2024-09-18 18:13:12 --> URI Class Initialized
INFO - 2024-09-18 18:13:12 --> Router Class Initialized
INFO - 2024-09-18 18:13:12 --> Output Class Initialized
INFO - 2024-09-18 18:13:12 --> Security Class Initialized
DEBUG - 2024-09-18 18:13:12 --> Global POST, GET and COOKIE data sanitized
INFO - 2024-09-18 18:13:12 --> Input Class Initialized
INFO - 2024-09-18 18:13:12 --> Language Class Initialized
INFO - 2024-09-18 18:13:12 --> Loader Class Initialized
DEBUG - 2024-09-18 18:13:12 --> Config file loaded: /PATH_REDACTED/application/config/website_settings.php
DEBUG - 2024-09-18 18:13:12 --> Config file loaded: /PATH_REDACTED/application/config/image_settings.php
INFO - 2024-09-18 18:13:12 --> Helper loaded: security_helper
INFO - 2024-09-18 18:13:12 --> Helper loaded: url_helper
INFO - 2024-09-18 18:13:12 --> Database Driver Class Initialized
INFO - 2024-09-18 18:13:12 --> Session: Class initialized using 'database' driver.
DEBUG - 2024-09-18 18:13:12 --> Smarty Class Initialized
Reply
#4

(09-18-2024, 09:43 AM)LuizFilipe Wrote:
(09-18-2024, 02:05 AM)Smekke Wrote: So I've inherited an old CI 3 project running on PHP7.0

I've upgrade to the latest CI 3 version and I want to make the change to PHP7.4 so that I can keep upgrading to CI 4, then upgrade to PHP8 etc.

95% of the site works fine but on some pages, I just get a blank page saying "Unable to locate the specified class: Session.php"


These are my autoloaded libraries:

Code:
$autoload['libraries'] = array('database','session','lib_smarty','module','form','tank_auth','user_auth');


I've looked through the forum for topics with a similar problem but most were either unresolved and/or their solution didn't work for me.
I've already installed a fresh copy of CI 3.1.13.

If I remove all libraries from the autoload, I am greeted with the following error.

Code:
A PHP Error was encountered

Severity: Notice

Message: Undefined property: Module::$session

Filename: core/Model.php

Line Number: 74

I don't know which version you started migrating from but the session library was completely rewritten. Did you follow the steps shown here? https://codeigniter.com/userguide3/insta...ading.html

I started from 3.0.4.
I did see in another topic someone said that going from 2.X to 3.0 there might be issues if you do not delete the system folder.
I've done that just to be sure but to no avail.

There is some improvement. Whenever I drop "model" from autoload libraries and mod_pages (a custom mod) from autoloaded models, the pages seem to work.
The rest of the site bricks because they don't get loaded, but I was thinking if I can adjust the rest to load the library and mod individually, it might just work.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB