PHP fopen() doesn't seem to work as expected

My project has a relay connected to an Arduino on the end of an ethernet cable. If I put the following into a browser (or use wget from a command line):

then the relay clicks as predicted.

However, if I try to open this URL with fopen (included in a file on the server):


then nothing happens.

I've looked in the logs and there is nothing. php.ini has allow_url_fopen = On set

Logging into the server via SSH and running php test.php on the command line

(where test.php contains only the fopen command) works fine but I can't seem to run it from a browser.

Copying the test.php file to my laptop and running it from the localhost works too but this doesn't really help with my predicament



That works fine... bizarre but there you go! :D