cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PHP file_get_contents doesnt work php 5.4.16

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. 

3 REPLIES 3
Super User IV

@alpineC 

 

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.

I am a GoDaddy End User - Just Like You
Check out my site! | I currently manage over 300 WordPress Websites
* Please note that I offer free advice on this forum. Thank You Info If you would like personalized help, please contact me. Otherwise, please ask your question in the proper forum so the answer can assist EVERYONE in the community and not just you. Thanks! *

Once your issue is resolved,
please be sure to come back and click accept for the solution

Get Better Support on the Community Boards!
Etiquette When Asking for Help from the Community

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.

Hi @alpineC,

 

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. 

 

 

TLH - GoDaddy | Community Moderator
Supporting you at x.co/247support