Coppermine and PHP4.4.1 Coppermine and PHP4.4.1
 

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

Coppermine and PHP4.4.1

Started by topagency, November 02, 2005, 05:12:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

topagency

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

josini

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
        (
           
  • => 2546
            )

    )

    ==========================
    USER DATA:
    ------------------
    Array
    (
       
  • => 1074
        [user_id] => 1074
        [1] => Coppermine
        [user_name] => Coppermine
        [2] => 3
        [mgroup] => 3
        [3] => 3
        [group_id] => 3
        [4] => Medlem
        [group_name] => Medlem
        [5] => 2048
        [group_quota] => 2048
        [6] => 0
        [has_admin_access] =>
        [7] => 1
        [can_rate_pictures] => 1
        [8] => 1
        [can_send_ecards] => 1
        [9] => 1
        [can_post_comments] => 1
        [10] => 1
        [can_upload_pictures] => 1
        [11] => 1
        [can_create_albums] => 1
        [12] => 0
        [pub_upl_need_approval] => 0
        [13] => 0
        [priv_upl_need_approval] => 0
        [14] => 3
        [upload_form_config] => 3
        [15] => 0
        [custom_user_upload] => 0
        [16] => 5
        [num_file_upload] => 5
        [17] => 3
        [num_URI_upload] => 3
        [groups] => Array
            (
               
  • => 3
            )

        [can_see_all_albums] =>
    )

    ==========================
    Queries:
    ------------------
    Array
    (
       
  • => SELECT extension, mime, content FROM cpg11d_filetypes;
        [1] => SELECT id as user_id, name as user_name, mgroup FROM `nissanklubbendk`.nkmembers WHERE id='1074' AND  member_login_key='***'
        [2] => SELECT * FROM cpg11d_usergroups WHERE group_id = '3'
        [3] => DELETE FROM cpg11d_banned WHERE expiry < 1130949860
        [4] => SELECT * FROM cpg11d_banned WHERE ip_addr='193.163.255.100' OR ip_addr='172.28.37.157' OR user_id=1074
        [5] => SELECT aid FROM cpg11d_albums WHERE visibility != '0' AND visibility !='11074' AND visibility NOT IN (3)
    )

    ==========================
    GET :
    ------------------
    Array
    (
    )

    ==========================
    POST :
    ------------------
    Array
    (
        [unique_ID] => ff1b228c
        [control] => phase_2
    )

    ==========================
    Page generated in 0.722 seconds - 6 queries in 0.004 seconds - Album set :

kegobeer

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.)
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

kegobeer

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.
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

josini

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.

kegobeer

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
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