views:

167

answers:

3

Hi all,

I'm trying to setup CutyCapt on my Ubuntu 10.4 server.

I generate a thumbnail using the following command in SSH:

xvfb-run --server-args="-screen 1, 1280x1200x24" ./CutyCapt --url=http://www.google.dk 
--out=/var/www/user/data/www/domain.com/test.png --min-width=1280 --min-height=1200

... and it's working great!

Though when I run the entire same command from a PHP file using shell_exec I get an error:

/usr/bin/xvfb-run: 181: ./CutyCapt: not found

Does anyone have an idea what's wrong?

Thanks in advance

+1  A: 

In which directory is CutyCapt? Is that the same directory from which you run xvfb-run?

Hint: Use an absolute path or something relative to $HOME or something like that. If you put the command above in a script, you can get a path relative to your script with:

DIR=$(cd $(dirname "$0") > /dev/null 2>&1 ; pwd)
Aaron Digulla
CutyCapt is found in cd cutycapt/CutyCapt
kris
`cutycapt` is not `.`, so the script fails.
Aaron Digulla
A: 

Hi,

try it with the following code:

xvfb-run --server-args="-screen 1, 1280x1200x24" /root/cutycapt/CutyCapt/CutyCapt --url=http://www.google.dk --out=/var/www/user/data/www/domain.com/test.png --min-width=1280 --min-height=1200

with the path from the root it should work.

A: 

Simply create a symlink for your CutyCapt executable in to your path

ln -s < cutycapt path > /usr/bin/CutyCapt

e.g.

ln -s /home/user_name/cutycapt/CutyCapt/CutyCapt /usr/bin/CutyCapt

Now don't use ./CutyCapt use CutyCapt instead..

Pravin