Ah, in that case there are no problems opening sockets from console.
The script is a simple port scanning utility so a browser can see what open ports he/she has. I didnt write the script but I have altered it so that it scans the browser's ip
I have tried two seperate scripts which do much the same thing but both fail with the "fsockopen(): unable to connect to " error.
Given that these are established scripts I wondered if something needed enabling to allow this function to work.