Jump to content

file_get_contents freezing new server


stevebeans2

Recommended Posts

I have a small network of sites currently on a VPS server, and I use file_get_contents in the wordpress theme to call a few things, like sidebar links, etc.

 

Anyway, it currently works on the VPS, but I purchased a dedicated server, and that appears to be causing a freeze when the pages load.

 

(allow_url_fopen is set to on btw)

 

I found out because wp-admin loads fine, stand alone pages are also ok, so I started stripping file_get_contents from my theme, and sure enough the blog loaded fine.

 

So my questions are,

 

1) Is there a setting on the server I'm missing to allow remote calls?  A port that needs opening, etc?

2) Is file_get_contents really the best way to call remote .txt files?

 

I'd like to figure out the answer to (1) because I don't have the time to go through 50+ blogs and convert file_get_contents to the new format before my VPS plan expires, but when the sites are migrated and I have time, I'd certainly like to convert the includes to a better format.

 

Thank you!

Link to comment
https://forums.phpfreaks.com/topic/243816-file_get_contents-freezing-new-server/
Share on other sites

An update....

 

I was able to find that the file_get_contents command works as long as I'm not calling files from my own server.  If I call from my old server, it appears to still be working.  Perhaps it's a DNS issue, or a setting on my server

Wow... I really am a noob.  I think I tried that when I first started blogging and doing my own themes, probably messed up a piece of the code or the server was whacked so I went to file_get_contents.

 

Oh well, learn something new.  This should lower some server load, that's for sure.

 

Thanks

 

(btw, as per my problem, it was fixed before this post.  I honestly don't know what fixed it, but I did a reboot of my DNS server and all is working now... crossing fingers)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.