PDA

View Full Version : PHP safe mode discrepancy


karim
28th of March 2005 (Mon), 21:10
Hi Pekka et all,

I'm still having trouble figuring out what's going with my webserver and EE. When thumbnails are generated, they remain the SAME size as the original size images. Hardly useful...

The log from the imagemagick command is aat the end of this message...

I have checked everything (rw permissions, path to imagemagick, image does contain data.)

Teh only thing that is very strange is that, according to phpinfo(), safe mode is turned off globally for the webserver, YET, EE reports that it's on. This may be what's causing the problem.

So my question is: how do you really know if php safe mode is off or on? How do you tur it off or on?

Thanks

k

# imagemagick log

msg 78304 | ftp: LOCAL: Working directory changed to '/xxxxx/xxxxxx/xxxxxxx/xxxxxx'
msg 78303 | ftp: LOCAL: Changed to passive mode
msg 78302 | ftp: LOCAL: Logged in as 'xxxxxxxxxxxxx'
msg 78301 | ftp: LOCAL: Connected to 'xx.xxx.xxx.xx'
msg 78300 | ftp: LOCAL: DISCONNECTED
msg 78299 | ftp: LOCAL:
'050326_2349_VB4U2254.JPG' UPLOADED SUCCESFULLY
SIZE: 670x453 => 110x74 thumb (IMAGEMAGICK 110) , 99 KB in server.
msg 78298 | imagemagick: IMAGEMAGICK COMMAND | /usr/bin/convert -size 110x74 UPLOAD/050326_2349_VB4U2254.JPG -resize 110x74! -unsharp 0x1.1+20+0.1 -quality 80 UPLOAD/ee_temp_upload/050326_2349_VB4U2254.JPG
IMAGEMAGICK ERROR:

POSSIBLE REASONS:
SAFE MODE ON? EE can not use ImageMagick when is it located outside PHP safe mode exec dir.
IMAGE IS EMPTY? Perhaps source image was zero size.
IMAGEMAGICK PATH CHANGED? Maybe your server admin has moved IM to another location.
FOLDER PERMISSIONS WRONG? check that UPLOAD folder and all folders inside it are chmod 0777 (full permissions)

Pekka
29th of March 2005 (Tue), 03:25
You should trust phpinfo, the "Local Value" setting (left hand column).

Some questions/suggestions:

What do you get in Graphics Modules editor when you do the imagemagick test? Is the result correct size?

Have you tried different profile commands?

Try adding "remove profiles" to thumbnail resize methods.

Do you have shell access? If you do you should go to shell, go to EE's input directory and there give the imagemagick command:
/usr/bin/convert -size 110x74 UPLOAD/050326_2349_VB4U2254.JPG -resize 110x74! -unsharp 0x1.1+20+0.1 -quality 80 UPLOAD/ee_temp_upload/050326_2349_VB4U2254.JPG
You will get a textual error message, or nothing if it works (you can check out ee_temp_upload for the result image). Does it work there?

Also, for Imagemagick path try using just convert instead of full path. The convert app should be in PATH.

karim
29th of March 2005 (Tue), 04:04
Hi Pekka, thanks for reading and replying.

>What do you get in Graphics Modules editor when you do the imagemagick test? Is the result correct size?

yes, all resize methods work perfectly when I try them.

>Have you tried different profile commands?

Do you mean to try with and without the "remove profile" option? yes, I tried that too.


>Try adding "remove profiles" to thumbnail resize methods.

Did that. It didn't help

>give the imagemagick command:
/usr/bin/convert -size 110x74 UPLOAD/050326_2349_VB4U2254.JPG -resize 110x74! -unsharp 0x1.1+20+0.1 -quality 80 UPLOAD/ee_temp_upload/050326_2349_VB4U2254.JPG

I have shell access. i tried the command and it the output is:
convert: Missing geometry (-unsharp). Makes me wonder if this is a more recent or older version of IM. convert -h gives: Version: @(#)ImageMagick 5.4.7 07/01/02 Q:16


>Also, for Imagemagick path try using just convert instead of full path. The convert app should be in PATH.

I tried that too. Just "convert" and "composite" instead of /usr/bin/convert and /usr/bin/composite

I'm out of luck so far. I'm wondering if the installed IM is an OLD version that doesn't have the -sharpen option in the compiled code or something...

Thanks Pekka. I'll keep looking and will report here, if I find anything.

k

Pekka
29th of March 2005 (Tue), 04:08
That IM is quite old.

If the test works then the culprit is sharpening settings.

In thumb and microthumb resizemethods untick sharpening off totally and save them. Or try just integer values in sharpening parameters. Try (preview) again and let me know what happened.

karim
31st of March 2005 (Thu), 07:23
That IM is quite old.

If the test works then the culprit is sharpening settings.

In thumb and microthumb resizemethods untick sharpening off totally and save them. Or try just integer values in sharpening parameters. Try (preview) again and let me know what happened.

Pekka, the problem was caused by that old version of IM. I got the sysadmin to install the latest version and everything was running smoothly again. As we suspected, the older version did not have sharpening built-in. It did work when I turned sharpening off in the resize methods...

So... Thank you Pekka!

k