RE: [PHP] Server change affecting ability to send downloaded files???
> -Original Message- > From: Brian Dunning [mailto:br...@briandunning.com] > Sent: 08 August 2009 01:04 > To: PHP General List > Subject: Re: [PHP] Server change affecting ability to send > downloaded files??? > > Very interesting. Excellent debugging advice. It's giving me a 500 > error, probably why the Rackspace techs told me to check my code: > > HTTP/1.0 500 Internal Server Error > Date: Sat, 08 Aug 2009 00:01:10 GMT > Server: Apache/2.0.52 (Red Hat) > X-Powered-By: PHP/5.2.10 > Content-Disposition: attachment; filename="Installer.bin" > Content-Length: 23223296 > Connection: close > Content-Type: application/octet-stream > > I'm at a loss. Nothing changed in the code and it works for ZIP > files. I notice the X-Powered-By header shows you are running on PHP 5.2.10. This was released on 18-June-2009, so Rackspace must have upgraded your PHP installation some time after that. I think it's a reasonable assumption that something is behaving differently in PHP 5.2.10 from how it did in whatever version you were running under before. You need to track down what that something is, and fix it! Cheers! Mike -- Mike Ford, Electronic Information Developer, Libraries and Learning Innovation, Leeds Metropolitan University, C507, Civic Quarter Campus, Woodhouse Lane, LEEDS, LS1 3HE, United Kingdom Email: m.f...@leedsmet.ac.uk Tel: +44 113 812 4730 To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server change affecting ability to send downloaded files???
http://us2.php.net/readfile Returns the number of bytes read from the file. If an error occurs, FALSE is > returned and unless the function was called as @readfile(), an error message > is printed. Ah. So readfile() was generating some error and outputting before the Content-Type was sent to the browser. It might not hurt to move to a fread($fh, 8096) + print() to prevent the bug in the future. Jerry Wilborn jerrywilb...@gmail.com On Sat, Aug 8, 2009 at 9:00 AM, Brian Dunning wrote: > A Rackspace guy determined that php.ini was set to use 16MB of memory, and > he upped it to 32MB, and now everything works. Some of my downloads are as > large as 41MB so I asked him to up it to 48MB. > > Maybe they upgraded the PHP version or something and wiped this setting. > The 41MB files had always been downloading to customers before, without any > problem -- is there some way that could have worked with php.ini set to > 16MB, or does this mean for sure that the setting was changed somehow? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Server change affecting ability to send downloaded files???
A Rackspace guy determined that php.ini was set to use 16MB of memory, and he upped it to 32MB, and now everything works. Some of my downloads are as large as 41MB so I asked him to up it to 48MB. Maybe they upgraded the PHP version or something and wiped this setting. The 41MB files had always been downloading to customers before, without any problem -- is there some way that could have worked with php.ini set to 16MB, or does this mean for sure that the setting was changed somehow? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server change affecting ability to send downloaded files???
The 500 is the result of the missing content-type in the real header. Once you get a blank line in there, it thinks thats the content. The error log will likely say 'premature end of script headers'... Good mystery on why it's got the blank line though. Jerry Wilborn jerrywilb...@gmail.com On Fri, Aug 7, 2009 at 7:16 PM, Ben Dunlap wrote: > > Very interesting. Excellent debugging advice. It's giving me a 500 > > error, probably why the Rackspace techs told me to check my code: > > > > HTTP/1.0 500 Internal Server Error > > Did you get that 500 while running curl from a machine outside of > Rackspace's > network? > > If so, I'd be interested to see what you get if you run it from the > server's > command line (using 'localhost' in the URL you pass to curl). > > Have you checked your Apache error log as well, and PHP's? There will > usually > be more detail in those locations when the server sends a 500. > > Ben > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Server change affecting ability to send downloaded files???
Change to cron -i to see what other information, if any, is also being passed back. You might get some errors, or some such. Since you are getting empty files my gut tells me you aren't getting anything. Since you are actually getting a PHP 500 error, that lends me to believe that it's not some type of external influence (aka the malware thoughts). Since the code looks reasonable, I'm thinking that it may be permission related. While your code/files may not have been updated, that doesn't mean that permissions were not. Trace through your file structure and see what's going on in the ../../store/files path. Adam. On Fri, Aug 7, 2009 at 5:05 PM, Brian Dunning wrote: > Correct, the files on the server have not changed either, and have been > working fine for a long time. No funny characters. > > On Aug 7, 2009, at 4:59 PM, Adam Randall wrote: > >> Sorry for replying to myself, but the files themselves only contain >> US-ASCII characters, and no quotes, correct? Having extended >> characters in your file names might cause weirdness, and quotes will >> break your HTTP header in your code there. >> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Adam Randall http://www.xaren.net AIM: blitz574 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server change affecting ability to send downloaded files???
> Very interesting. Excellent debugging advice. It's giving me a 500 > error, probably why the Rackspace techs told me to check my code: > > HTTP/1.0 500 Internal Server Error Did you get that 500 while running curl from a machine outside of Rackspace's network? If so, I'd be interested to see what you get if you run it from the server's command line (using 'localhost' in the URL you pass to curl). Have you checked your Apache error log as well, and PHP's? There will usually be more detail in those locations when the server sends a 500. Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server change affecting ability to send downloaded files???
Correct, the files on the server have not changed either, and have been working fine for a long time. No funny characters. On Aug 7, 2009, at 4:59 PM, Adam Randall wrote: Sorry for replying to myself, but the files themselves only contain US-ASCII characters, and no quotes, correct? Having extended characters in your file names might cause weirdness, and quotes will break your HTTP header in your code there. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Server change affecting ability to send downloaded files???
Very interesting. Excellent debugging advice. It's giving me a 500 error, probably why the Rackspace techs told me to check my code: HTTP/1.0 500 Internal Server Error Date: Sat, 08 Aug 2009 00:01:10 GMT Server: Apache/2.0.52 (Red Hat) X-Powered-By: PHP/5.2.10 Content-Disposition: attachment; filename="Installer.bin" Content-Length: 23223296 Connection: close Content-Type: application/octet-stream I'm at a loss. Nothing changed in the code and it works for ZIP files. On Aug 7, 2009, at 4:57 PM, Adam Randall wrote: Can you do a commandline test with curl to see what you get back? curl -I http://url/file.php?something=here That should allow you to see what is actually being produced by the code, and if it's being tweaked in some manner unknown to you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php