I am trying to run a PHP function inside Bash... but it is not working.
#! /bin/bash /usr/bin/php << \'EOF\' EOF
Alternatively:
php_cwd = `php -r 'echo getcwd();'`
replace the getcwd(); call with your php code as necessary.
EDIT: ninja'd by David Chan.