Warning: fsockopen(): php_network_getaddresses: gethostbyname failed in test.php on line 4
Warning: fsockopen(): unable to connect to h**p://127.0.0.1:80 in test.php on line 4
Couldn't connect to h**p://127.0.0.1: Error: 0 Desc: The operation completed successfully.
The problem may lie on the PHP.INI or PHP installation, but I don't know what. Since I have also tried accessing Google (which is accessible via normal means of an Internet browser) with this script but the script returned the same error message too (but this time it failed to connect to google.com). Maybe it's not my Apache's problem because if it is, the script must have been able to connect to Google. If not the PHP, maybe the problem lies in my network configuration or DNS, which I have no idea of how to set.
I am using Windows XP Home Edition SP1, PHP 4.3.8 and Apache 2.0.50.
Sorry for the h**p because the forum won't let me post URLs before I reach 5 posts.
i have a feeling that its ur host that prevents the use of fsock. Most people disable the use of fsock including me, it can cause very big problem when exploited ....
i suggest u request from your host (or even yourself) to enable fsock if you really need it.....If I remember correctly, being in safe mode can also cause this problem, so turn off safe mode if you're in it........ gd luck.. lol
Then how can I enable fsock in my own localhost? I will use this for my internal company SMS server which is cut off from the Internet so I think it will be quite safe to enable it in this matter. Besides, all other NowSMS users are also using the fsockopen method, so I think it should be no problem.
Yes I have enabled Curl in my configuration but it's confusing to use.
Can you help me to convert the code above to Curl?
The actual script which will be used for SMS doesn't differ much from the above, the only difference will be in the $page variable and the contents of $request and how the data will be retrieved. I will be using GET here, not POST, because NowSMS mainly supports GET functions.
I guess you can find a online converter around the web .... go to google and search for php to curl converters... I ever converted php to asp using a convert before =) Good luck... i cant help you with the link becux not at home now