I believe your Geo balance code has errors or is out of date.
Around line 62,
These lines do not work and breaks script with syntax error, unexpected [ character
It took me about an hour of testing to find the error.
Bit I think this works:
So I guess, for sub regions you use square brackets [ ] ,
but for 2 digit country codes, there are no square brackets [ ] ?
Now I have fixed that and the runs, but it still does not work and do geo balance, the lines 100 (test links) always reverts to default server.
Can we have edit feature on forum?
"Now I have fixed that and the runs" lol. should say "Now I have fixed that and the script runs"
test.php lines 100 - 106 always echo the default server and do not get my country code from my IP.
this line is correct:
Reference code tested on PHP 5.5.30
Could you please check what return php -v?
PHP 5.3.3 (cli) (built: Jul 9 2015 17:39:00)
Please upgrade to 5.5 then
OK thanks guys. got it to work at last :)
Maybe put minimum version 5.5 on the Github guide?
For anyone else with centos:
yum update php didnt work
centos 6 only goes up to 5.3.
centos 7 goes to 5.4
so I followed this page https://www.mojowill.com/geek/howto-install-php-5-4-5-5-or-5-6-on-centos-6-and-centos-7/
My site is unavailable due to "DNS errors" after updating PHP. not sure what php has got to do with DNS! for now I access site via ip address. If anyone has any ideas what could be the problem with that?
15 minutes later site works. Maybe cloudflare. I also clear cache on FF and site works.
For anyone else who might like this. Here is a list of country codes in CSV format.
I can sort data by region (eg, asia) copy/export the 2 digit codes & format somehow to add ' ', and paste in to geo balance script, saving a lot of time!
Thank you for the feedback and updates.
and required to achieve the purposes illustrated in the
If you want to know more or withdraw your consent to all or some of the cookies, please
refer to the