Page 1 of 1

Strange problem : cron vs browser

Posted: 2011-04-13T02:52:09-07:00
by skyg
Hello

OS : CentOS 5.5 64b
IM Version : ImageMagick 6.6.8-6 2011-04-08 Q16
GS version : GPL Ghostscript 9.02 (2011-03-30)

Im using IM and GS for a file managing systeme with thumbs for some file formats like jpg, png, eps, etc...

My code worked fine untill a change to a new server, i cant figure this ptoblem out.

My code works fine wen i call the script via a web browser, but wen i try the cron, it only works with jpg and png files.

I suppose its something to do with GS because this problem is with EPS and PDF files and GS is the delegate (is that right ?)

Here is the line that converts a PDF file :

Code: Select all

/usr/local/bin/convert -colorspace RGB -quality 90 -density 80 /home/full/path/to/file.pdf -thumbnail 55 /home/full/path/to/file.jpg
The exat PHP code :

Code: Select all

$commande = "/usr/local/bin/convert -colorspace RGB -quality 90 -density 80 ".$filePath.$TheFileName." -thumbnail 55 ".$filePathCache.$cacheFileName;
exec($commande, $output, $debug); 
I debugged the PHP variables, and all is ok, even wen called from cron.

I repeat, this code works fine if i test my cron script via a web browser, but fails without any error if used by the cron system itself.

I tested the users privileges via SSH and it worked fine wen using that same command.

Is there some way to specifie where GS is wen calling convert ?

Thanks for any ideas !

Just ask for any information you might think is important.

Sky

Re: Strange problem : cron vs browser

Posted: 2011-04-13T06:00:09-07:00
by skyg
For information, this is the information i get from the php variables :
output: --nostringval-- --nostringval-- --nostringval--
debug:0:CRIT: rangecheck in .setuserparams;1:Operand stack:;2: --nostringval-- --nostringval-- --nostringval--;
I suppose this is just the end of teh error generated, no idea how to get more.

Re: Strange problem : cron vs browser

Posted: 2011-04-14T00:02:04-07:00
by anthony
Cron typically has even less of an environment setup that the web server!
The script that cron calls need to ensure the PATH and other environment has been fully defined for what you want it to do.