406 error with s2Member Pro login widget on new host

After migrating to new hosting (Liquid Web) my client gets a 406 error when using the s2Member login widget. The new host and the old both use Nginx, but this problem didn’t happen on the old host. I had support check this out and they found nothing unusual, but were unable to get it working.

Any help appreciated - can I use a different login widget? If so what’s recommended? I’d rather get this one working if possible.

Hi Debbie.

From what I see, 406 errors could be related to mod_security. https://www.inmotionhosting.com/support/website/error-numbers/406-error

Please see this article and follow the advice there: https://s2member.com/kb-article/mod-security-odd-403-503-500-errors/

I hope that helps! :slight_smile:

1 Like

Unfortunately there is no mod_security in use. That was one of the things we checked early on, but thank you.

Thanks for the update.

I’m not sure if it could help, but please try this tool to see if it sheds some light. https://s2member.com/kb-article/server-scanner/

Thanks! I’ll try this tomorrow.

1 Like

I found these two pages informative:

The only problems the server scanner found were:

Error[ERROR] MySQL Database Extension
Missing MySQL extension. s2Member needs the MySQL extension for PHP. This will add MySQL support to your installation of PHP, allowing MySQL database communication. Please consult with your web hosting company about this message.

Error[ERROR] Mcrypt/Encryption Extension
Missing Mcrypt extension. s2Member needs the Mcrypt extension for PHP. This will add encryption support to your installation of PHP, with a variety of block algorithms; such as DES, TripleDES, and Blowfish. Please consult with your web hosting company about this message.

My host is using mysqli and mysqlnd and says Mcrypt was removed from PHP 7.2 after being deprecated in 5.5.

They had me downgrade to PHP 5.6 to see if that helped but it made no difference.

My host suggests removing s2Member and reinstalling it. That sounds scary - will all my client’s settings be preserved?

And - is there an alternative login plugin that I can try?

You can safely delete the plugin and to upload the fresh version, just set “Dashboard -> s2Member -> Plugin Deletion Safeguards” to “Yes”.

Any login plugin will works, s2M is compatible with the usual WP login mechanism.

1 Like

I set up a brand new empty WP site with new s2Member and Pro, and tried the Pro login widget there. Same 406 error. So that implies the problem is with my host, right?

Also, I tried Clean Login on the live site and test site, and that isn’t working at all, it doesn’t log me in. That seems weird.

Yes, problem most likely is your host…

The error you got with the “server scanner” may be the reason, but may not be too - scanner itself is quite old, PHP deprecated the old MySQL extension, replaced it with a new one. So this may be “false positive” signal.

Most likely Mcrypt is the issue. Can you switch to lover PHP version, like 5.6?

1 Like

Yes - we tried PHP 5.6, same thing, 406 error.

Yeah, it seems to be something related to how this new host is configured…

It’d be nice to find what it is about it, though, to know what would be needed to change to make it happy.

Update - I tried the s2Member shortcode (https://s2member.com/kb-article/s2member-login-shortcode-documentation/) in a widget on the test, empty site and it worked totally fine with a redirect. When I copied this over to the live site, 406 error. Liquid Web is still investigating.

1 Like

If it helps at all, I use GetFlywheel and never had a problem with my sites. They are really great at customer service too and do free migrations. :slight_smile: nothing in this for me just really like them + S2 together!

1 Like

I got this fixed, but not by using the s2Member shortcodes. I wound up removing the s2 login widget and replacing it with a button to wp-login.php. Other login redirects (Peter’s Redirects?) are working fine, it’s just something about the s2 code.

I used to be with Flywheel, I moved 65 clients in December to Liquid Web because of too many support issues (32-hour tickets, conflicting info from techs on the same ticket, blacklisting my IP for SFTP and not figuring it out for 6 hours, etc.).

1 Like

Glad you got it fixed! Sorry you had issues with Flywheel - I know they grew a lot so maybe growing pains. Recently they introduced 24 hour support.

Again, glad you got it fixed. :slight_smile: