error 500 image upload

Permalink
I get an error 500 in multiple image upload, what could be the right solution? version 5.4.1.1

thanks
Jorg

 
jordanlev replied on at Permalink Reply
jordanlev
Do you get the error with single file uploads as well? If so, then it's because you don't have proper permissions set on your "files" directory on your server. If the single file uploading works, though, then I'm not sure.

I did have a client who could never get the multiple uploader to work, across multiple C5 sites on his server -- but since it happened on every site on his server but I never saw it happen anywhere else I assume it was specific to that server's setup. And I have no clue what would be causing that problem or how to fix it (hopefully someone else has an answer though).
Ewc replied on at Permalink Reply
it is only on multiple upload and safe mode is off
stuball replied on at Permalink Reply
stuball
I have had the same problem. Individual file uploads work fine, but in multiple file uploads some files report 500 error after a long delay. Most frustrating. Any help appreciated!
jasteele12 replied on at Permalink Reply
jasteele12
Since a single file works, you may be hitting a PHP max setting.

Try putting this code in tools/php-maxes.php:
<?php /* tools/php-maxes.php */
defined('C5_EXECUTE') or die('Access Denied.');
$maxes = array ('max_execution_time',
                'max_file_uploads',
                'max_input_time',
                'max_input_vars',
                'post_max_size',
                'upload_max_filesize');
foreach($maxes as $max) {
    echo show_ini($max);
}
function show_ini($str) {
    return $str. ': '. ini_get($str). '<br/>';
}
?>

Then call it like so:http://yoursite/tools/php-maxes... (without the annoying ... added to the link by concrete5.org)

Also, does this still happen if you only upload like 3 very small images?
jero replied on at Permalink Reply
jero
Error 500 usually implies a broken bit of code or more likely a server configuration problem. There should be a web server error log file somewhere (it depends entirely on your hosting set up so I can't say where) which I would expect to give more detailed information on what triggered the error.
stuball replied on at Permalink Reply 1 Attachment
stuball
Jasteele and Jero - thank you! Excellent suggestions.

First, I checked the server http logs and found several instances of:

Premature end of script headers: index.php

Not very helpful. Then I configured PHP to generate a log and no errors were logged (I tested to make sure logging was working).

It's worth noting that the same files consistently fail on upload multiple and that these work on a single upload. I've attached one of the non-working files in case it's of interest (antique lace3.jpg).

I attempted an end-around by uploading the files to the files/incoming folder and importing them from there (Upload Multiple | Add Incoming). The script hung up on this as well, although after refreshing the page I saw that some of the "trouble" files were imported. Again, not much information to go on and no interesting log errors.

Finally, all files are under 150KB. No seeming correlation to odd file names or extensions. PHP max_filesize is 9M. I doubled the allowable PHP memory limit for fun but no dice. Host is Dreamhost.

On to other projects to clear my head. Thanks again!
jasteele12 replied on at Permalink Reply
jasteele12
Your hosting provider is not allowing pictures of toilets! :)

Seriously, "Premature end of script headers" usually involves server configuration or CR/LF problems.

You probably should time how long it takes before you get the error (in seconds), that number may become useful.

Is the host running FastCGI? I've seen this error before with IPCCommTimeout being too low.

If so you could try this in your .htaccess (180 is 3 minutes):
<IfModule mod_fcgid.c>
IPCCommTimeout 180
</IfModule>

If not, I think you're going to have to ask your hosting provider.
jero replied on at Permalink Reply
jero
Premature end of script headers: index.php - that's an indication that the script has not output the appropriate header information - likely because it's crashed. The lack of info in the error log is most likely because the script that's crashing has error_reporting disabled.

I might be wrong, but I think the hard work is done in
concrete/tools/files/importers/multiple.php, judging by my Apache log. It might be worth adding some debug into there and seeing what falls out.

You won't see any C5 logging if you're getting a 500, because PHP has basically given up at that point.