简体   繁体   中英

WHMCS PHP Sessions Not working

My WHMCS installation suddenly stopped working two days ago. I can access the client area, but can't login... after I input the correct details, the browser keeps trying to load a page but no page ever loads. I created a test file and confirmed it an issue with PHP sessions. Seeing as it's probably not the script, since WHMCS is a widely-used and tested software, I'm trying to figure out what possible configurations could cause php sessions to not work. /tmp is writable, and I set the directory specified in php.in, session.save_path = "/var/lib/php/session" to 777 permissions. I read somehwere that the session.save_path folder should NOT be under the user control of root; mine is. What should I set it to? I have no other users. In the gc.compatibility was 1 and I set it to 0, and restarted httpd, but still can't login. Here's the phpinfo:

http://192.155.82.64/clients/phpinfo.php

This is running on the latest Debian distro. Thanks in advance!

Are you using Cloudflare? If so, make sure to set your firewall to LOW.

Or, go WHMCS Setup > Security and check Disable Session IP Check.

After checking the WHMCS admin log i noticed i was logging in from Cloudflare ips and every time the ip changed, i got logout.

Your best bet is to ask the guys at WHMCS. With your software comes 24x7 email support and they really know what they're doing.

Otherwise, what is the page it tries to load (but doesn't) when you login ?

Your session directory (/var/lib/php/session) should NOT be set to the root user. It needs to be set to the user and group that runs Apache (sometimes its apache, or nobody). You can check if the directory is the problem by locating the PHPSESSID cookie value and see if a file is created in the session directory. You can try asking WHMCS about this but they may charge you for their time.

I've had the same issue, and the culprit was session.auto_start being enabled. After disabling it, everything worked fine.

I have the same problem and fixed it by disabling zlib.output_compression in my php.ini

So figured I would chime in since I was having this problem.

Specifically, for Cloudflare. I had to add their IPs to WHMCS as Trusted Proxies System Settings > General Settings > Security Tab .

In the Trusted Proxies list, I put all of the CIDR IPs from Cloudflare 's own website.

https://www.cloudflare.com/ips/

After that, I changed the " Proxy IP Header " to " X_FORWARDED_FOR ".

Seems to be working now. I originally was getting logged out every 2 minutes or so. If that.

I hope this helps someone as I spent a while trying to find an answer.

Also, quickly add those IPs because you might get timed out before finishing. Just log back in and repeat as quickly as possible. Once you hit "Add" and save the IP it actually saves right then. Even though you didn't click the save button at the bottom of the " Security Tab "

Check your .htaccess file and rename it to something like .htaccess2 just to make sure that's not messing with it.

You could have PHP configuration set in this file that may be causing issues, by setting session configuration, parameters, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM