php中的exec工作不当

I am willing to execute a shill command through PHP but i faced that the command is not executing , here is the command:

exec('/cutycapt/CutyCapt --url="' . $source . '" --out="/home/user/NetBeansProjects/PhpProject1/htmlImage/example.png"');

i tried as testing to execute the following :

echo exec(' ls  /cutycapt/');//print_r is the same

only one file returned while this command returned them all

echo system(' ls  /cutycapt/');

i tried to use the "system" method instead of exec in the first command and the result was the same

what could affect the command so it wan't execute ?

update

the case i'm talking bout the the first command work whether i run it in the terminal or i run the PHP script in terminal too but when i run it from the browser (the php script )it doesn't work !!

Look into manual - http://de3.php.net/manual/en/function.exec.php exec and system returns "The last line from the result of the command"

In case of system and exec the last line from the result of the command gets returned. If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.

I had the same problem working with external commands in php. The problem was related to file permissions. I was using "vchiq" library and the error was "* failed to open vchiq instance". This page might work for you.