php_syntax_checker
php_syntax_checker copied to clipboard
Mac OSX Compatibility
PHP Syntax Checker seems to be not working in SublimeText 2.0.1 x64 and Mac OS Lion 10.8.3
I have same issue while using SublimeText 2.0.2 on Mac OS X 10.9.4. After some testing, I think the problem is on php.
The syntax check command used in file PhpSyntaxChecker.py is: EXECUTE_COMMAND = "php -l"
And I have following versions of php, "5.3.29", "5.4.24", "5.5.15". 5.4.24 is Mac OS X built-in, which locate in "/usr/bin/php"
Wrote a test php file "a.php" which has some error and test with built-in php. It returns nothing...
So I change the "EXECUTE_COMMAND" with the other version of php. EXECUTE_COMMAND = "/opt/local/bin/php53 -l"
And it works fine for me.
$php -v PHP 5.4.24 (cli) (built: Jan 19 2014 21:32:15) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
$php53 -v PHP 5.3.29 (cli) (built: Aug 24 2014 01:46:13) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2014 Zend Technologies
$php55 -v PHP 5.5.15 (cli) (built: Jul 25 2014 13:17:32) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
$php -l a.php No syntax errors detected in a.php
$php53 -l a.php
Parse error: syntax error, unexpected T_VARIABLE in a.php on line 4 Errors parsing a.php
$php55 -l a.php
Parse error: syntax error, unexpected '$a' (T_VARIABLE) in a.php on line 4 Errors parsing a.php