Strange image upload problem.

Hello, great ZenPhoto team!

I am visiting your site/forum, every day, so I will start this post with things I believe every post on forum should start with. (System info, ZenpPoto info and how ZenPhoto is installed)

System info:
-----------------

Apache/2.2.22
(Unix) mod_ssl/2.2.22 OpenSSL/0.9.8e-fips-rhel5 DAV/2 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 mod_fcgid/2.3.6
PHP/5.3.10

Zenphoto info:
-----------------

Zenphoto version 1.4.3 [10393] (Official build)
Current locale setting: en_US.UTF8
Current gallery theme: custom (mix on default and zenpage themes)
PHP version: 5.3.10
Graphics support: PHP GD library bundled (2.0.34 compatible)
supporting: gif, jpg, jpeg, png, bmp
PHP memory limit: 96M (Note: Your server might allocate less!)
MySql version: 5.0.95

How Zenphoto is inhaled?
------------------------

Classic method of installation, files sent to server via FTP, manually created SQL database, run setup.php...
Actually, current version is updated from previous version, and version before that... (About 2.5 - 3 years old site.)

About problem:
--------------

I have problem with uploading images via Zenphoto back end admin panel.
When I try to upload image(s) with upload handler: http
after few seconds after click to start uploading I get: "500 Internal Server Error"

If I try upload handler: flash
I get "HTTP Error"

If I try upload handler: jQuery
Sometimes it looks like image is uploading, then folder where image should be uploaded opens with green note with "Your files have been uploaded."
But there is no that image in folder. And sometimes nothing is happening at all.

But it is not like that for all images I am trying to upload.
If I try to upload small size image ( about 50 kb) then everything if fine, image is uploaded no matter which method I use.
So, I tried to find out if I am getting problem related to image size in pixels (resolution of image), or it is problem related to actual size of image in bytes.

Then I tried to upload images in different resolutions and with some I had problems with some not.

For example I can not upload image in resolution 1600 x 1200 pixels, with size about 150 kb, but I can upload image in resolution 1920 x 1200 with size about 50 kb.

After testing, and testing, I found that problem is not resolution of image, it is size of image in bytes.

For example I can upload image in resolution of 2233 x 3654 pixel. I made that image, blank gray image, jpeg, with small size of just 127.08 kB (130.125 bytes)
But If I make that same image just little more bigger in size 130.191 bytes then I have problem with uploading that image.
So everything is fine up to 127.08 kb, any smaller image I can upload without any problem.

Also, it is important to note that I nave no problems with any image if I upload it via FTP, no matter if size is bigger than 127 kb. Image if found, resized, everything if fine then, problem is just uploading images using admin back end, and with images bigger than about 127 kb.

On upload page I can see this:

"Note:
ZIP files must contain only Zenphoto supported image types.

The maximum size for your total upload is 8MB which is set by your PHP configuration post_max_size.

Don't forget, you can also use FTP to upload folders of images into the albums directory!"

Also my "upload_max_filesize" in php.ini is 32MB

If there is something I need to change in my php.ini file or something else, please advice.

Best regards.

Comments

  • Have you looked in your server log for any errors? Off hand I do not know why size would be a problem so long as it is within the PHP limits (which it apparently is). Maybe there is some other limit. For instance there are limits on how much data can be in a "post" request. That should not be involved with the uploads, but maybe there is something eles we do not know of.

    Since all three uploaders fail, it is probably something on the server side, so maybe there will be an error message somewhere telling us what.

    [edit]BTW, thank you for your very thorough posting. This kind of information is really helpful. Sorry that maybe this time there is not enough, but you have done a nice job of reporting your problem.
  • Jole Member
    Hello again.

    Thank you for your informations.

    There is no any errors, there is no error_log in root of site, or in zp-core flder or in any other folder, also there is no errors in debug.log in zp-data folder.

    Is there some other place where I should look for errors?

    Also, I tried to go back to 1.4.2.4 then back to 1.4.2.1 then again back to current version, but problem is active on all versions. Also I have one more site on the same server with Zenphoto CMS and when I tried on that site, I realized that I have same problem. So you are right, it is probably something on the server side.

    Could you please tell me where to look? I have access to WHM, so I can look around and make changes. But where to look, and for what?

    Best regards.
  • About the only thing I can think of is for you to put some debugging statements into the upload handler script. In this case the simplest would be the http uploader.

    You can start by placing the followind just after the require_once statement in `uploader_http/uploader.php`

    `debugLogVar('HTTP uploader $_POST', $_POST);`

    keep moving the line down in the code until you do not get anything placed into the debug log. (Clear the log between tries.) That will give us what got posted and where the upload script stopped.
  • Jole Member
    I tried to paste:
    `debugLogVar('HTTP uploader $_POST', $_POST);`
    in line 3 of uploader_http/uploader.php file.

    like this:
    `

    define('OFFSET_PATH', 3);

    require_once(dirname(dirname(dirname(__FILE__))).'/admin-globals.php');

    debugLogVar('HTTP uploader $_POST', $_POST);

    `
    Tnen, I tried to upload image 1920 x 1200 px, size about 50 kb in test folder (created during upload). I get this in debug log in zp-data folder:
    ----------------------------------------------------------
    {Tue, 17 Jul 2012 06:10:16 GMT} Zenphoto v1.4.3[10393]
    HTTP uploader $_POSTarray(10) {
    ["albumselect"]=>
    string(0) ""
    ["publishalbum"]=>
    string(7) "checked"
    ["albumtitle"]=>
    string(4) "test"
    ["autogenfolder"]=>
    string(2) "on"
    ["XSRFToken"]=>
    string(40) "78991cf210daf3e814518fd6da39e9f7d3c4abc1"
    ["existingfolder"]=>
    string(5) "false"
    ["auth"]=>
    string(32) "2d8761887b8edd9c5efa805ff2a3b214"
    ["id"]=>
    string(1) "2"
    ["processed"]=>
    string(1) "1"
    ["folder"]=>
    string(4) "test"
    }
    ---------------------------
    Image uploaded successfully.

    Then I cleared debug log file and tried to upload larger image (larger in kb).

    I tried to upload image in resolution 800x600 about 131 kb and after some time I was redirected to:
    http://www.site-name.com/zp-core/zp-extensions/uploader_http/uploader.php
    with "500 Internal Server Error" message. I tried several times with different images larger than 127 kb, and sometimes instead of "500 Internal Server Error" I got custom 404 page.
    And always without anything in debug log in zp-data or without any error_log file anywhere.
    And always with images larger than about 127 kb, I tried multiple times with different images with smaller size and upload is successful with log in debug log similar with one I provided above.

    Is there anything i can do to help you to find where is problem, so you can help me then?

    Best regards.
  • Unfortunately, what this means it that the Zenphoto upload processing script is not being launched when when the failure occurs. That means it is a problem either in the browser or the server in handling the upload request. I am afraid I do not know what might be causing this, though.

    But a start would be to ask your service provider if there are any data limits that might be interrupting the HTTP upload process since it certainly seems data size related.
Sign In or Register to comment.