Jump to content

Connection closed error message


Tyssen
 Share

Recommended Posts

I site I did a while ago has suddenly stopped working. I'm guessing a change on the server but the error message I'm getting when trying to access the site with debugging turned on is:

Fatal error: Exception: Connection closed (in wire/core/Session.php line 55) #0 /wire/core/Session.php(55): session_start() #1 /wire/core/ProcessWire.php(138): Session->__construct() #2 /wire/core/ProcessWire.php(46): ProcessWire->load(Object(Config)) #3 /index.php(183): ProcessWire->__construct(Object(Config)) #4 {main} in index.php on line 214
 
Fatal error: Uncaught exception 'RedisException' with message 'Connection closed' in [no active file]:0 Stack trace: #0 {main} thrown in [no active file] on line 0
 

The site is running on a LiteSpeed server with PHP 5.4.16. I've checked the db settings and they're correct.

Link to comment
Share on other sites

According to the web hosting company, they resolved the issue by commenting out #ini_set("session.save_path", rtrim($config->paths->sessions, '/')); in index.php. Is that likely to have consequences elsewhere though?

Link to comment
Share on other sites

I guess your host has enabled some kind of redis based sessions that clashes with file based one that PW uses. That RedisException is definitely not coming from PW, maybe from phpredis: https://github.com/nicolasff/phpredis/issues/184

One option to think is to install "Session Handler Database" module (comes with PW core) that moves sessions from file based to mysql database.

Not sure how the redis sessions work at your host, so not sure if that helps at all. It seems that the host is taking sessions from pretty low level anyways.

Which host you are using?



According to the web hosting company, they resolved the issue by commenting out #ini_set("session.save_path", rtrim($config->paths->sessions, '/')); in index.php. Is that likely to have consequences elsewhere though?

Probably only that you do not find sessions files from /site/assets/sessions/ (they go into your hosts redis db).

  • Like 1
Link to comment
Share on other sites

Which host you are using?

NetRegistry, an Australian company. Been having trouble with them lately with other clients whose sites have been migrated without notice. In one case, had to move the site to a completely different host altogether. Don't have that option here as I don't have direct contact with the client.

Link to comment
Share on other sites

ProcessWire's session setup is pretty much 100% consistent with PHP's recommended setup for them. I'm guessing that change the host made would affect most CMSs. But they probably only care if it affects WordPress. :) I agree with Apeisa that switching to the database sessions might have fixed it in this case, as it's specifying a custom session handler rather than letting PHP go it's usual session route. But it sounds like this host's change may have broken it to the point where you couldn't even enable that module from the server. It might require moving site site to a local/dev server, installing the module, then moving it back. A pain for sure. If this site is still down, let me know and I'll see if I can come up with anything simpler to do the switch for you. 

Link to comment
Share on other sites

This site is running 2.2.9.2 and the SessionHandlerDB module's not there.

As the site is working OK with the session.save_path line commented out in index.php, I've been told to not bother with any more changes, but just wanted to check if there would be any adverse effects further down the line with that change in place. If not, then happy to leave it as is.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...