Jump to content

Sudden slowness when using file operations


iamgregor

Recommended Posts

I don't know what changed, but suddenly all my pages have a 20 to 50 second load delay on my local test server. I was able to finally figure out that the commands that are causing the slowdown are file operations using file or fsockopen.

 

I don't understand what went wrong or how to fix it. Any ideas? I already tried reinstalling Apache, PHP, and MySQL from scratch.

Link to comment
Share on other sites

file and getimagesize cause the slowdown and file_exists does not. HELP!

 

Also note, that this didn't have a problem a few days ago and the only thing I've done since then was import a bunch of images to one of my websites via a script I wrote. I don't know how that could have changed web server behavior though.

Link to comment
Share on other sites

And an error message that I get:

 

Almost forgot: Here's one of my error messages:getimagesize(http://localhost/teaser.jpg) [function.getimagesize]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

Link to comment
Share on other sites

Well, I seem to be the only one talking here, but that's ok. I solved most of the problem by taking the time to figure out the filepath on my server (since all the images I'm working with are on my server anyway) and just using file_exists. The problem now is getting the width and height using a different function than getimagesize.

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.