Why doesn't lint tell me the line number and nature of the parse error?

If you get the "Errors parsing foo.php" message without any details, this parameter shows errors when you run PHP lint:

php -d display_errors=1 -l foo.php

Example:

[somewhere]# php -l submit.php

Errors parsing submit.php

[somewhere]# php -d display_errors=1 -l submit.php

Parse error: syntax error, unexpected T_VARIABLE in submit.php on line 226
Errors parsing submit.php

I've accepted Charles's answer, but thought I should add a couple of details, as I had to do some extra hunting to find out what to do.

The problem was that I wasn't seeing the stderr output, so I started by adding 2>&1 to the end of the relevant commands. This still didn't help, so I realised that the problem was that PHP wasn't outputting stderr stuff at all. I went to the PHP install directory and looked in php.ini and found that by default, display_errors is Off. Changed it to On and it now works.

Tags:

Php

Lint