Problem uploading images

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
ganesha
Posts: 29
Joined: Mon 13. Dec 2004, 18:45
Location: Italy
Contact:

Problem uploading images

Post by ganesha »

the problem is this:

when i upload a picture from the File section of the phpwcms (1.2.5) beckend,
i receive this warning:
Warning: imagejpeg(): Unable to access .../httpdocs/125/content/images/dc9db16f9119f9c7cf60d3b1483c1005.jpg in .../httpdocs/125/include/inc_ext/ss_image/ss_image.class.php on line 202
and picture isn't available

what's happend?
the script has uploaded the file in the /phpwcms_filestorage folder
but it has given permission 600 (and the owner of the file is the ftp user, not apache)
so when the script tries to read that file (with the apache user, i suppose), it hasn't sufficient rights.

another instance of phpwcms on another hosting works fine...

any idea
thanks
Last edited by ganesha on Sun 20. Nov 2005, 20:19, edited 2 times in total.
ganesha
Posts: 29
Joined: Mon 13. Dec 2004, 18:45
Location: Italy
Contact:

Post by ganesha »

no, the rights aren't the problem...

uploading manually the file in the /phpwcms_ftp folder, the permissions are correct (666) but the warnings remain and the problen is the same...
ganesha
Posts: 29
Joined: Mon 13. Dec 2004, 18:45
Location: Italy
Contact:

Post by ganesha »

another thing

i've discovered that there are images that i'm able to upload..
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

Hello

Not shure ... but perhaps "GIF" Files ?

In 1.2.6 GIFs work very well ... perhaps thats the reason

:roll:
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Re: Problem uploading images

Post by DeXXus »

ganesha wrote:another instance of phpwcms on another hosting works fine...

any idea
thanks
Note: This function is only available if PHP is compiled with the bundled version of the GD library.
Maybe... make sure ~this~ hosting has GD available??
ganesha
Posts: 29
Joined: Mon 13. Dec 2004, 18:45
Location: Italy
Contact:

Post by ganesha »

i can upload only the images that are below the following values of conf.inc.php

Code: Select all

// content values
$phpwcms["file_maxsize"]      = 2097152; //Bytes (50 x 1024 x 1024)
$phpwcms["content_width"]     = 800; //max width of the article content column 
$phpwcms["img_list_width"]    = 100; //max with of the list thumbnail image
$phpwcms["img_list_height"]   = 75; //max height of the list thumbnail image
$phpwcms["img_prev_width"]    = 600; //max width of the large preview image
$phpwcms["img_prev_height"]   = 500; //max height of the large preview image
$phpwcms["max_time"]          = 3600; //logout after max_time/60 seconds
because, i suppose, the script don't have to resize those images

hince the problem should be: the script cannot modify images!

but why?

see my phpinfo()
:roll:
User avatar
DeXXus
Posts: 2168
Joined: Fri 28. Nov 2003, 06:20
Location: USA - Florida

Post by DeXXus »

If you've tried raising those values and they do not work...

Maybe PHP itself (or your Host limits) are the problem?

See topic:
[DEV 1.2.5] can't upload a file that's greater than 1024KB
http://www.phpwcms.de/forum/viewtopic.p ... ht=maxsize
ganesha
Posts: 29
Joined: Mon 13. Dec 2004, 18:45
Location: Italy
Contact:

Post by ganesha »

solved!

the problem was due to php 4.4.1 and the function imagejpeg

i fixed it this way:

in file include/inc_ext/ss_image/ss_image.class.php line 202
change this:

Code: Select all

			} else {

				imagejpeg($image, $where, $this->cfg_JPEG_QUALITY);
			}
in this:

Code: Select all

			} else {
				$fh=fopen($where,'w');  //fix for php 4.4.1
				fclose($fh);            //fix for php 4.4.1
				imagejpeg($image, $where, $this->cfg_JPEG_QUALITY);
			}
ciao
User avatar
Oliver Georgi
Site Admin
Posts: 9907
Joined: Fri 3. Oct 2003, 22:22
Contact:

Post by Oliver Georgi »

nono,

this is definitly a problem of your hosting account ;-) and not of phpwcms.

Your provider has to change permission settings for your account. If an image is uploaded into a folder with right permissions you can have access on it.

Oliver
Oliver Georgi | phpwcms Developer | GitHub | LinkedIn | Систрон
Post Reply