代码如下 | 复制代码 |
check_php_syntax.sh #!/bin/bash |
使用,例如:
代码如下 | 复制代码 |
./check_php_syntax /home/liuzhichao/test/ |
输出:
错误文件:2个
错误行数:
PHP Parse error: syntax error, unexpected T_VARIABLE in /home/liuzhichao/test/awktest/a.php on line 3
PHP Parse error: syntax error, unexpected T_STRING, expecting ')' in /home/liuzhichao/test/levelcity.php on line 19