Removing comments from PHPPosted: April 6, 2017
Sometimes it is enough to remove comments from your PHP code to make it not worth stealing, as a potential violator will spend more time figuring out what did you mean by all that, than writing his own version of the software to do the same job.
This very simple solution, based on an example in a forum here, does that for all files in the directory and its subdirectories.
find . -type f -name '*.php' | while read VAR; \
do mv $VAR "$VAR-old"; php -wq "$VAR-old" > $VAR ; \
unlink "$VAR-old"; done
Unlike obfuscators, it does not mess with your actual code.
The php options engaged here are:
-w Output source with stripped comments and whitespace
-q Quiet-mode. Suppress HTTP header output (CGI only).