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
Share on other sites

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)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.