I was using file_get_contents function in my php for long time, suddenly it stops working and giving me the warning.
failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time,
I have tested the url I used in file_get_contents which works fine from my local host. What could be the issue.
A couple of thoughts 1) You REALLY need to upgrade to PHP 7.x
beside for the fact of better performance and security PHP 5.x is past EOL at this point
2) I know that on certain servers with GoDaddy they block remote file open for security purposes as otherwise someone could upload a script which then opens a malicious script from an external source.
Once your issue is resolved,
please be sure to come back and click accept for the solution
Thanks for the feedback, I am using windows shared hosting, I can see two php version 5.4 and 5.6, I have upgrade to 5.6 and tested the same php, but same result. Actually I have to get some data from third-party server using php.
Welcome to the Community!
If you are on one of the older servers, you may wish to upgrade and migrate to a newer Plesk plan. Such a move would enable you to use a more recent version of PHP, taking advantage of the enhanced functions.