coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Upload => Topic started by: topagency on November 02, 2005, 05:12:23 PM

Title: Coppermine and PHP4.4.1
Post by: topagency on November 02, 2005, 05:12:23 PM
hello
i have the same problem on my copermine
the company that my site is host in upgrade to php 4.4.1
i talked with them and the problem is with this version 4.4.1
they set it back to 4.4.0 and everything was ok
so i just want you to know the problem is in php 4.4.1
copermine cpg 1.3 have a bug* with this ver. of php.
the bug* is in the file upload.php.

*not sure its a bug maybe a missmatch between versions.

hope you will fix it sonn

thanks in advanced

gilad

www.topagency.co.il/copermine (http://www.topagency.co.il/copermine)
Title: Re: Coppermine and PHP4.4.1
Post by: josini on November 02, 2005, 05:50:38 PM
I have the same problem after server-upgrade to PHP4.4.1.

I'm not able to upload anything - have tried all described in "Troubleshooting".

Link: http://www.nissanklubben.dk/foto

Test-user: Coppermine
Test-pw: fun4free

The file-upload is OK and I can see it on the server in the /edit folder with name: mHTTP_temp_0f73ca9b.JPG and file-privileges -rw-rw-rw- but when I click continue I get the following:
Warning: imagejpeg(): Unable to access ./albums/edit/preview_4e203626.JPG in /net/users/a26/475/nissanklubbendk/www/foto/include/picmgmt.inc.php on line 209

Warning: imagejpeg(): Invalid filename './albums/edit/preview_4e203626.JPG' in /net/users/a26/475/nissanklubbendk/www/foto/include/picmgmt.inc.php on line 209

Warning: chmod(): Unable to access ./albums/edit/preview_4e203626.JPG in /net/users/a26/475/nissanklubbendk/www/foto/include/picmgmt.inc.php on line 215

Warning: chmod(): No such file or directory in /net/users/a26/475/nissanklubbendk/www/foto/include/picmgmt.inc.php on line 215

Warning: getimagesize(): Unable to access ./albums/edit/preview_4e203626.JPG in /net/users/a26/475/nissanklubbendk/www/foto/include/picmgmt.inc.php on line 217

Warning: getimagesize(./albums/edit/preview_4e203626.JPG): failed to open stream: Permission denied in /net/users/a26/475/nissanklubbendk/www/foto/include/picmgmt.inc.php on line 217


Output from log:
USER:
------------------
Array
(
    [ID] => 655fab58d9b461365af6471842e438bd
    [am] => 1
    [liv] => Array
        (
           
Title: Re: Coppermine and PHP4.4.1
Post by: kegobeer on November 02, 2005, 07:09:54 PM
Do you have the same issue when doing a batch add?

This sounds suspiciously like an ownership issue.  Look in the edit directory and see who owns the image (not what the permissions are.)
Title: Re: Coppermine and PHP4.4.1
Post by: kegobeer on November 02, 2005, 07:21:23 PM
Is your server running PHP in safe mode?  There is a bug report at bugs.php.net about safe_mode and imagejpeg() in 4.4.1.

http://bugs.php.net/?id=35060

To test this, open up picmgmt.inc.php, find (around line 209)

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

and replace with

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


See if that fixes the problem.
Title: Re: Coppermine and PHP4.4.1
Post by: josini on November 02, 2005, 10:23:26 PM
Quote from: kegobeer on November 02, 2005, 07:21:23 PM
Is your server running PHP in safe mode?  There is a bug report at bugs.php.net about safe_mode and imagejpeg() in 4.4.1.

http://bugs.php.net/?id=35060

To test this, open up picmgmt.inc.php, find (around line 209)

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

and replace with

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


See if that fixes the problem.
Fantastic....!!! That minor code-fix fixed problems with upload. And YES - my server runs in safemode!

Thx.
Title: Re: Coppermine and PHP4.4.1
Post by: kegobeer on November 02, 2005, 11:57:39 PM
Glad that your issue is resolved.  I posted a sticky topic about 4.4.1 and imagejpeg().

http://forum.coppermine-gallery.net/index.php?topic=23342.0