Error : Make sure your PHP session configuration is valid and working

Hi,

I have the error when I try a fresh install of MODX 2.8.2 :

FATAL ERROR: MODX Setup cannot continue.

Make sure your PHP session configuration is valid and working.

My apache error log is empty.

My server is running well other MODX websites and I don’t know why this error is appearing on new MODX install.

That sounds a lot like the sessions aren’t working for that site… the setup checks that by initialising a session, setting a value to it, and then redirecting to a different page within the setup and making sure it has the value in the session. That check is apparently failing.

I’m not sure why that might be failing though, as I’ve never actually encountered it before. Perhaps a domain/host, https, or php configuration issue?

Could try inspecting the request/responses to see how the session cookie gets defined and why that might not persist after the redirect.

Here is the answer header inside the debug console :

HTTP/1.1 404 Not Found
Server: nginx
Date: Sun, 09 May 2021 13:46:14 GMT
Content-Type: text/html; charset=UTF-8
Content-Length: 0
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=csopsl5ffdlrv9nelhddb6du9e; expires=Sun, 16-May-2021 13:46:13 GMT; Max-Age=604800; path=/; secure; HttpOnly

And the request header :

GET /favicon.ico HTTP/1.1
Host: www.website.fr
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0
Accept: image/webp,*/*
Accept-Language: fr,fr-FR;q=0.8,en-US;q=0.5,en;q=0.3
Accept-Encoding: gzip, deflate
Connection: keep-alive
Referer: http://www.website.fr/setup/index.php?s=set

I don’t know if is can help…

That’s for the favicon - you’d need to find the initial request for setup/index.php which then redirects (so that’ll have a 301 or 302 status code).

It does look like the Set-Cookie includes the secure flag, which makes it only available on HTTPS, but the Referer on the request indicates HTTP. Are you on HTTP or HTTPS? If you’re on HTTP but cookies are limited to HTTPS that would certainly explain it.

The domain is an existing domain, hosted elsewhere and the website is working : https://www.parisfacecachee.fr/

I have in charge to move this website on my own server.
But as I said, for this particular domain name, the MODX installation doesn’t works

You can easily reproduce the issue by adding on your hosts file this line :

92.243.18.234  www.test.fr test.fr parisfacecachee.fr www.parisfacecachee.fr

Because parisfacecachee.fr is existing, I can’t have https for now, but normally it doesn’t matter.
By bypassing the DNS resolution with the hosts file, you can access to my server with http://www.parisfacecachee.fr (no https) and you will see the default MODX warning than the config file is not set.
Now, you can go there :

The test.fr setup is working, but not parisfacecachee.fr
And if I try on another server I have the same strange result.

I don’t understand from where the issue is coming…

there is definitely something wrong with the domain name configuration (and I don’t have access to it).
The issue is existing only for it, so it’s not a server side issue…
Very strange…

I will add my feedback for this error message from my recent experience moving a client to a new GoDaddy shared server. It was a problem updating to the latest 3.0.3 MODX version. And since it is a shared server, all I had to work with was my cPanel access and file manager.

I found that for me, the “Make sure your PHP session configuration is valid and working.” error was due to two things. First, the ‘session.auto_start’ directive was set to Off for my local value. Second, even with that set to On I could not get things to work. I had to update the sessions save path.

What I did with only file manager access was to edit the .user.ini file in the website root folder (public_html). I created a folder in my public_html folder and set my session.save_path directive to that folder in the web root’s .user.ini file:

session.save_path = /home/<SITE NAME>/public_html/<FOLDER NAME>

Lastly, in the same .user.ini file, I added the directive:

session.auto_start = On

as the first line.

Once I did that, I no longer received the error message when trying to install using the yoursite.com/setup path. Hope this helps someone struggling.

You’ll probably want to tweak that to put the sessions outside of the webroot for security reasons. But thank you for returning with your feedback for others!

Thanks for your answers.
Finally I give up about this migration… to much work at this time to go further…
The website stay on the original server and another team make the job with my help.

Hi, I had the same error.
It turned out that on the server I had set the session.save_path variable (the variable specifies the folder where the session files will be stored) to the /tmp folder. But there was no such folder. I just added the /tmp folder and the installation was possible.

1 Like