On my Qnap the php CLI command for the default Qnap PHP 5.3 didn't work. I've been searching for a sollution for a while and finally found one.
For everyone who has the same problem on his qnap, just login to your qnap via SSH and execute the following command:
ln -s /mnt/ext/opt/apache/bin/php /opt/bin
This will simply create a symlink to the default php 5.3 in a directory on your path(it even survives a reboot of your qnap).
To see if it works:
[/share/] # php -v
PHP 5.3.26 (cli) (built: Sep 12 2013 05:30:14)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies
That's it!