Upload suddenly fails (has always been working!) (Updated) Upload suddenly fails (has always been working!) (Updated)
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Upload suddenly fails (has always been working!) (Updated)

Started by henfri, December 04, 2005, 09:15:11 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

henfri

Hi,

since yesterday, I'm having problems integrating new photos into my gallery (coppermine 1.3.5).
No matter, wether I try to use the Coppermine Web interface (errormessage see below),  the XP Publishing wizard (no error message), or the imatch to coppermine Importscript, the categories are created, but no photos show up.
Here's the error message.

Warning: imagejpeg(): Unable to access ./albums/edit/preview_5a4023c2.jpg in /export/websites/6/15/hf335976/coppermine/include/picmgmt.inc.php on line 218

Warning: imagejpeg(): Invalid filename './albums/edit/preview_5a4023c2.jpg' in /export/websites/6/15/hf335976/coppermine/include/picmgmt.inc.php on line 218

Warning: chmod(): Unable to access ./albums/edit/preview_5a4023c2.jpg in /export/websites/6/15/hf335976/coppermine/include/picmgmt.inc.php on line 224

Warning: chmod(): No such file or directory in /export/websites/6/15/hf335976/coppermine/include/picmgmt.inc.php on line 224

Warning: getimagesize(): Unable to access ./albums/edit/preview_5a4023c2.jpg in /export/websites/6/15/hf335976/coppermine/include/picmgmt.inc.php on line 226

Warning: getimagesize(./albums/edit/preview_5a4023c2.jpg): failed to open stream: No such file or directory in /export/websites/6/15/hf335976/coppermine/include/picmgmt.inc.php on line 226


I have already deleted a gallery, so space limitations can't be the problem.
Besides that I have really not changed anything. So I really don't have a clue, what could cause the problems.

Sorry, but I can't find out about permissions, as I only have Web-Dav access to the site. But that should not be a problem, as it has always been working.

The System:
Php:
./configure' '--with-ssl=/opt/rz/openssl-0.9.7i' '--with-ndbm' '--with-db' '--with-mysql' '--with-ftp' '--with-gettext' '--with-gd=/usr/local' '--with-zlib-dir=/usr/include' '--enable-safe-mode' '--enable-memory-limit' '--with-apxs=/opt/rz/apache_1.3.34/bin/apxs' '--prefix=/opt/rz/php-4.4.1'

PHP API    20020918
PHP Extension    20020429
Zend Extension    20050606

Php 4.4.1.


Regarding th FAQ:

1. max_input_time- 60 seconds is the default time limit for uploading files.

its -1, the upload definetly works though (the message comes after the 'upload successful' message)

2. upload_max_filesize - 2MB is the default limit for individual files.

its 10M

3. post_max_size - 8MB is the default limit for post requests.

its 8M

4. memory_limit - 8MB is the default size.

tis 10M

5. PHP's LimitRequestBody - 512KB default limit. (mainly an issue on Redhat/Apache systems.  Found in /etc/http/conf.d)

I don't have access on this, but it's a solaris system.

>In general, upload_max_filesize < post_max_size < memory_limit in order for uploads to function properly. Coppermine may warn you if a file exceeds >upload_max_filesize, but it cannot warn you if the total size of all the files exceeds the post limit or the memory limit.

The files are not large (about 1 Mega Pixe)

6. file_uploads - This determines whether or not PHP will allow file uploads. It must be set to 'On'.

Jepp, it's on. the Upload definetly works.

7. upload_tmp_dir - This specifies the temporary directory where PHP stores uploaded files.

it has 'no value'
I don't quite understand the exolaination of this point. Thus I don't know wether this setting is ok?

8. allow_fopen_url - This controls PHP's ability to read files using URL/URIs.  If it is disabled, Coppermine will not be able to upload from URLs.

I can't find this setting. I'm not uploading from a URL though.



Do you have any Idea, what could cause the problem?

Greets,
Hendrik


henfri

Hi Nibbler,

thanks for your quick reply. I thought 'that must be it'! But seemingly it isn't.
I fixed that section to
        case "gd1" :
            if (!function_exists('imagecreatefromjpeg')) {
                cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);
            }
            if ($imginfo[2] == GIS_JPG)
                $src_img = imagecreatefromjpeg($src_file);
            else
                $src_img = imagecreatefrompng($src_file);
            if (!$src_img) {
                $ERROR = $lang_errors['invalid_image'];
                return false;
            }
            $dst_img = imagecreate($destWidth, $destHeight);
            imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);
            $fh=fopen($dest_file,'w');
fclose($fh);
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
            imagedestroy($src_img);
            imagedestroy($dst_img);
            break;

        case "gd2" :
            if (!function_exists('imagecreatefromjpeg')) {
                cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);
            }
            if (!function_exists('imagecreatetruecolor')) {
                cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the config page', __FILE__, __LINE__);
            }
            if ($imginfo[2] == GIS_JPG)
                $src_img = imagecreatefromjpeg($src_file);
            else
                $src_img = imagecreatefrompng($src_file);
            if (!$src_img) {
                $ERROR = $lang_errors['invalid_image'];
                return false;
            }
            $dst_img = imagecreatetruecolor($destWidth, $destHeight);
            imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);
            imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
fclose($fh);
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
            imagedestroy($src_img);
            imagedestroy($dst_img);
            break;
    }

Which should be ok now. But I still get the same error.
As I mentioned, this has been working ever since I installed coppermine.
I would be surprise, if my ISP has updatet PHP recently, because then they would have updated to php5, wouldn't they? Just a guess.

Do you have any other Idea?

Regards,
Hendrik

Nibbler


kegobeer

Incorrect:

            imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
fclose($fh);
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);


Correct:

            $fh=fopen($dest_file,'w');
fclose($fh);
imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

henfri

I'm very sorry for that.

It works now. Thanks a lot!

Greets,
Hendrik