Error after php upgrade

Error after php upgrade

by Deepak Kumar -
Number of replies: 13

Hello All 

I am facing the issue when upgrading moodle site php version from 7.0 to 7.2. 
With 7.0 site working fine. 

After upgrading error is only on  landing page, On which I made custom changes. But admin part and all other pages are working fine with php 7.2

Moodle Version: 3.5

Error:

Debug info: 
Error code: An error occurred whilst communicating with the server
$a contents:
Stack trace:
  • line 79 of /lib/classes/session/manager.php: core\session\exception thrown
  • line 791 of /lib/setup.php: call to core\session\manager::start()
  • line 855 of /config.php: call to require_once()
  • line 31 of /index.php: call to require_once()
 
Thank you
Deepak


Attachment errror.png
Average of ratings: -
In reply to Deepak Kumar

Re: Error after php upgrade

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers

The issue comes probably from your modifications in core code

What changes have you made exactly and into what file?

In reply to Jean-Roch Meurisse

Re: Error after php upgrade

by Deepak Kumar -

Thanks for your reply Jean-Roch

I don't think the issue in the custom code.

I removed everything except.  
require_once('config.php');
 And still error.  

In reply to Deepak Kumar

Re: Error after php upgrade

by Jean-Roch Meurisse -
Picture of Core developers Picture of Plugin developers Picture of Testers

Where is your custom code exactly, when is it called?

In reply to Jean-Roch Meurisse

Re: Error after php upgrade

by Deepak Kumar -

I added that in the index.php file in the root folder

In reply to Deepak Kumar

Re: Error after php upgrade

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

This typically happens when you have some content output before the session starts.

This can be because you have something like an echo call... or it can happen because you have some whitespace before the opening PHP tag.

My bet is that there is an empty newline, or an empty space, or some other hidden character on or before the <?php tag.

Andrew

Average of ratings: Useful (3)
In reply to Deepak Kumar

Re: Error after php upgrade

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Deepak,
are you using Redis to store Moodle sessions?
I also mean, anything different from the default file system.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: Error after php upgrade

by Deepak Kumar -

Hello Matteo
Thanks for your reply. I am not using anything different from the default file system.
the error is only when I change the version to 7.2 form 7.0 via the panel.
Thank you
Deepak

In reply to Deepak Kumar

Re: Error after php upgrade

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Deepak,

if you change the php version on the fly you have to clear the moodle cache. Just delete the folders "cache" and "localcache" in moodledata.

Best regards
Andreas

In reply to Andreas Grabs

Re: Error after php upgrade

by Deepak Kumar -

Hello Andreas

After changing php version just removed both cache and localcache folder from moodle data. But still not working. 

Thank you


In reply to Deepak Kumar

Re: Error after php upgrade

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Deepak,
FYI there is a known issue when using Redis (MDL-60951).

Could you try to use the plain Moodle version of the code just to verify if your changes could be the root cause?
If confirmed, please describe those changes and we'll try to help you.

HTH,
Matteo

In reply to Deepak Kumar

Re: Error after php upgrade

by Fred Woolard -

Fairly certain the PHP 7.2 fixes/changes in session handling, and call to session_start() is returning false, which results in session manager throwing an exception with that particular message.

Likely not your customized code, unless you're changing session manager/handler code, or somehow altering the setup.php.

Suggest you open a bug ticket at tracker.moodle.org. Also double check sessions done with files, and not in DB.