The script you posted displays the IP address displayed by the web server myip.dnsomatic.com. It doesn't make sense to me that the public web server myip.dnsomatic.com receives a connection from a private IP address and returns a response to that private IP address. Something is wrong with this picture!
Maybe your php command isn't executing the script you think it is. Do you get the same result if you specify the full path to the getip.php script in the php command?
Maybe your DNS is returning a different IP address for myip.dnsomatic.com from what I get on my system. If the correct getip.php script is being executed then it would appear your system thinks myip.dnsomatic.com is on the pfSense's WAN subnet - your TP-LINK router trying to be helpful? What do you get from the shell command: ping -c 1 myip.dnsomatic.com
On my system I see:
$ ping -c 1 myip.dnsomatic.com
PING updates.dnsomatic.com (208.69.38.210) 56(84) bytes of data.
64 bytes from 208.69.38.210: icmp_seq=1 ttl=50 time=204 ms
–- updates.dnsomatic.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 204.111/204.111/204.111/0.000 ms
$