Luey
asked on
image magick will not upload any image larger than 100KB
Hello, I have an upload image program that another programmer wrote a few years ago. It uses image magick. It has been working fine for a few years. All of the sudden it stopped uploading any images over about 100KB. I do not have a clue what it could be. Recently added SSL to this particular site. But can try it at http and still cannot get it to upload any over 100KB. Any help would be appreciated. Thanks
This is from the include
This is from the include
<?php
//function to upload image and check type
function upload_image($file_name) {
if (isset($_FILES[$file_name])) {
//validate the type. Should be JPEG or PNG.
$allowed = array('image/pjpeg', 'image/jpeg', 'image/JPG', 'image/X-PNG', 'image/PNG', 'image/png', 'image/x-png');
if (in_array($_FILES[$file_name]['type'], $allowed)) {
return $image_type = "ok"; }
else
{ return $image_type = "error"; }
}
}
//end of upload image function
//function to reduce and move image - receives path for permanent location
function move_image($file_name, $full_path, $short_path, $image_width) {
// find ext
$ext = end( explode('.', $_FILES[$file_name]['name']) );
//get timestamp
$stamp = mktime();
//set the file location
$new_image = $full_path.md5($_FILES[$file_name]['name']) . $stamp .'.' .$ext;
$stored_name = $short_path.md5($_FILES[$file_name]['name']) . $stamp .'.' .$ext;
$original_image = $_FILES[$file_name]['tmp_name'];
$size = GetImageSize($original_image);
//default max width is 300 unless specific width passed to function
$max_width = "300";
$max_height = "300";
If ($image_width) {
$max_width = $image_width;
$max_height = $image_width;}
exec("convert -size {$size[0]}x{$size[1]} $original_image -thumbnail $max_widthx$max_height $new_image");
return $stored_name; }
?>
ASKER
Just ran phpinfo() and both are set to 10M
ASKER
and nothing in htaccess about any of that.
And the upload form itself?
Maybe this...
http://pivica.me/blog/500-internal-server-error-while-uploading-files-bigger-then-100kb-modfcgid-problem
Are you using a framework
Maybe this...
http://pivica.me/blog/500-internal-server-error-while-uploading-files-bigger-then-100kb-modfcgid-problem
Are you using a framework
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I am still working on your previous answers guys but I wanted you to know i get this in my error logs win it does not upload.
[Wed Oct 01 19:25:47 2014] [client 98.92.245.104] Failed loading /usr/php/54/usr/lib64/php/ modules/Ze ndGuardLoa der.so: /usr/php/54/usr/lib64/php/ modules/Ze ndGuardLoa der.so: undefined symbol: zend_new_interned_string, referer: https://www.thecowboyshoponline.com/brand_submit.php
[Wed Oct 01 19:25:47 2014] [client 98.92.245.104] , referer: https://www.thecowboyshoponline.com/brand_submit.php
[Wed Oct 01 19:25:47 2014] [client 98.92.245.104] libgomp: Thread creation failed: Resource temporarily unavailable, referer: https://www.thecowboyshoponline.com/brand_submit.php
[Wed Oct 01 19:25:48 2014] [client 98.92.245.104] File does not exist: /home4/thecowbo/public_htm l/error_im age.php, referer: https://www.thecowboyshoponline.com/brand_submit.php
[Wed Oct 01 19:25:47 2014] [client 98.92.245.104] Failed loading /usr/php/54/usr/lib64/php/
[Wed Oct 01 19:25:47 2014] [client 98.92.245.104] , referer: https://www.thecowboyshoponline.com/brand_submit.php
[Wed Oct 01 19:25:47 2014] [client 98.92.245.104] libgomp: Thread creation failed: Resource temporarily unavailable, referer: https://www.thecowboyshoponline.com/brand_submit.php
[Wed Oct 01 19:25:48 2014] [client 98.92.245.104] File does not exist: /home4/thecowbo/public_htm
I don't know much really about Zend (bar using Magento), but maybe something in Zend was updated that changed the default file size upload limit.
ASKER
This is on a shared server and I do not use any of that. I still say this problem is at the server because I have exact same code working on other sites with the same host. I will keep digging. Thanks
Look at setting
MAGICK_THREAD_LIMIT=1
MAGICK_THREAD_LIMIT=1
Check your .htaccess or php.ini file for these two settings
php_value upload_max_filesize
php_value post_max_size
...and check what they are set to
Also check if you have a max size set in the upload FORM.