Support Forum

Links to external media files

MW Mike Warren
Mike Warren
Member

If I include a link to an external audio or video file there is a very long delay when I click the post button. It’s as if the complete file is trying to be loaded somewhere.

Example: http://mike-warren.net/pc3/Close_Grand_II.mp3

 

Edit: It doesn’t happen on this forum, only mine. Any idea where I could look for a cause? I discovered this when posting a link to a very large video file. When I clicked “Submit Post” the page went blank and was still like that an hour later.

38 Answers

New Answer

MW Mike Warren
Mike Warren
Member

I asked someone else to try it for me and it worked for him, but he said it took 20 seconds.

 

For me, what happens when I click the submit button:

– The small message that normally pops up at the top of the window saying “Saving Post. Please wait” doesn’t appear.

– Instead, the page goes blank and this is shown in the address bar:

mysite.com/index.php?sp_ahah=post&sfnonce=33e03ed543

 

Any ideas how I can work out what’s going wrong? This is a show stopper for me.

MW Mike Warren
Mike Warren
Member

I just tried with Chrome and instead of a blank page I get an error message: “HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfil the request.”

MW Mike Warren
Mike Warren
Member

Testing here:

<link removed>

 

Definitely works here. this is strange.

 

I’ll try another support request with my host. Last time they just said the error was caused by a faulty script.

MW Mike Warren
Mike Warren
Member

My host says this is caused by the forum software trying to allocate more than my allowed 64MB of memory.

It’s as if the file itself is trying to be loaded.

I just tried renaming the file from .mp4 to .zip and it posted fine. Then I renamed it back to .mp4 and it still posted fine. It’s like the problem just fixed itself. frown Perhaps the host changed something without telling me. I hate mysteries like this. They tend to come back and bite me.

I guess it’s back to more testing.

MW Mike Warren
Mike Warren
Member

No, it’s not fine. I had miss-typed the link. One thing has changed, though. I now actually get an error message:

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 110628865 bytes) in mywebsite.com/wp-includes/class-http.php on line 1106

Off to see if I can find that file.

MW Mike Warren
Mike Warren
Member

Line 1106 is calling a function called curl_exec()

$theResponse = curl_exec( $handle );

I cant find that function, but I suspect it’s not relevant anyway.

 

So what I’ve been able to determine:

-If I rename the mp4 file to .zip, the link posts fine.

-The link to the mp4 file posts fine on this site. And it’s fast. There is no delay.

-A new WP installation using the TenTwenty theme and only SP added to it exhibits the same problem.

-Links to smaller media files post fine, but there is a delay as if the file is being loaded somewhere. The out of memory error would tend to support this theory.

 

<link removed>

MW Mike Warren
Mike Warren
Member

Many more tests later and I’ve discovered this is not just related to media files. The reason I thought renaming it to zip was working was just a coincidence. It doesn’t fail every time. About 1 out of 10 times the post will submit successfully.

MW Mike Warren
Mike Warren
Member

I wonder if anyone else would like to try and duplicate this?

For me, posts including this link always work, even it the link is listed several times.

http://mike-warren.net/files/Test32MB.txt

This link gives me the out of memory error: Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67174401 bytes) in /wp-includes/class-http.php on line 1106. Note the amount of memory trying to be allocated is exactly the size of the file.

http://mike-warren.net/files/Test64MB.txt

 

And finally, here is an even larger one:

http://mike-warren.net/files/Test128MB.txt

MP Mr Papa
Mr Papa
Member

so your server could be very slow going outside…  have you verified you have curl installed on your server???

we know nothing, nada, zip, about links and where they go…  we do nothing with them…. unless image in which case we have to determine size…

but the message says your server is running out of php memory… do you have antivius software or other that might be scanning the file on the link???

MW Mike Warren
Mike Warren
Member

Something is definately trying to allocate enough memory to hold the file. I just don’t know what. I’m not aware of any anti-virus software running on my web server.

I’ve had 2 other people test it for me, including a support person at my web host (ixwebhosting), both had the same error.

MP Mr Papa
Mr Papa
Member

now keep in mind, images may try to display, audio may try to post, video may try to play, if embedded…. that is how wp and sp work… but just a link will not be loaded…

MW Mike Warren
Mike Warren
Member

Mr Papa said

 but just a link will not be loaded…

That’s what I would expect, and yet something is trying to allocate enough memory to hold the file, even if it’s a text file, as I mentioned earlier.

Do you know how much memory you have available here?

MW Mike Warren
Mike Warren
Member

I think this has beaten me. frown

  • SP 4.5.1 also fails, but even on the 32MB test
  • You say SP could not cause this.
  • ixWebhosting says it’s not them.
  • WP posts containing the same links work.
  • PHPBB posts containing the same links work.
  • SMF1 posts containing the same links work.
  • Mingle forum posts containing the same links work.

I have no idea where to go from here to get SP to work for me.

MW Mike Warren
Mike Warren
Member

One last experiment:

I installed xampp on my win7 machine all settings are at the defaults.

Created a test site and installed WP and SP. Nothing else, not even any SP plugins.

Created a folder called files in the local test site and copied the 128MB text file to it.

Created one SP forum.

 

I then tried creating posts with links to large files in them.

Linking to the 128MB file on the local machine works.

Linking to the 128MB file on my web host fails.

Linking to a large test file I found on another site also fails. ( http://download.thinkbroadband.com/100MB.zip )

 

The interesting thing here is that running from localhost the error is no longer an out of memory one. It’s a timeout error.

Fatal error: Maximum execution time of 120 seconds exceeded in C:xampphtdocsmike-warren_netwp-includesclass-http.php on line 906

 

Line 906 is   $strResponse = stream_get_contents( $handle ); which looks like it’s trying to load the file to me.

 

Given this new information and the fact that I now have a local setup I can play with, is there anything you want me to try?