strace /usr/bin/php -q /var/www/test.php > strace.log 2>&1

http://www.hokstad.com/5-simple-ways-to-troubleshoot-using-strace.html