One liner to count lines excluding comments and empty lines
# All files, with grep
find . -type f -exec cat {} \; | grep -v -E '^\s*(//|\*|\*/|/\*\*|$)' | wc -l
# PHP Files, with awk.
find . -iname '*.php' -type f -exec cat {} \; | awk '$0 !~ /^\s*(\/\/|\*|\*\/|\/\*\*|$)/{ print $0 }' | wc -l