Headsup for anyone using PHPjabber scripts

This has taken me forever to nail down, but I’ve found the problem and a fix.

This is a real “corner case” issue, but I know others use PHPJ scripts so figured worth mentioning.

The problem…

On Safari/IOS the scripts work fine, but you can’t add anything to the basket/checkout. This issue was very intermittent, but it’s now very consistant, I think due to an update.

The “corner-case” part of it…

I host sites on several servers but all my databases are on their own server. It’s fully configured and secure and all that, and all my servers are setup to use databases across them, so that isn’t the root of the issue. But, this is how I run things, I have reasons for doing it this way.

I realise most will only have the one server, and if that’s you and you use PHPJ scripts you won’t see this issue, but if you runs things like me, you will.

What’s going wrong…

Safari is fine with the database and the site being on different domains/servers, until anything needs to get added to the checkout, then it shits itself. Chrome is fine.

What made this problem really hard to nail down is that if you publish a test copy of the script to the same server as the database (doesn’t matter about the domain) the script in this location works. And to make things really hard to fathom out, once you’ve added to the basket using this test version of the script, back on the site that was having the problem, the problem is now gone, it now works!

It’s like Safari sees the database on the other server being used OK and thinks "oh, OK, that server/script/database/whatever is now OK so you can use it as normal.

This has been a nightmare to work out, but we now know the issue: Safari needs the database and the site to be on the same server, doesn’t matter about the domain.

So, if you are getting reports back about checkout issues with PHPJ scripts and have your database on a separate server to the site, this is the reason!

2 Likes