Originally posted by **Nickwiz** June 14, 2022
When using ALE with PHP as cgi, shell script ... and using `namespace` the first lines can be something like:
```php
#! /usr/bin/env php
Namespace declaration statement has to be the very first statement or after any declare call in the script
It complains about the *shebang* and note that PHP does so if the file is redirected instead of used as an argument, i.e:
**OK:**
```sh
$ php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0 test.php
No syntax errors detected in test.php
$ php test.php
OK
$ ./test.php
OK
```
**BAD:**
```sh
$ php -l -d error_reporting=E_ALL -d display_errors=1 -d log_errors=0
By default ALE uses stdin (redirection) for passing the data to the linters but this can be changed by setting the lint_file option to "1". See :h ale#linter#Define. Unfortunatelly this change would require changes to ALEs code as this cannot be changed via config and also reading files from disk disables linting while typing. Read the docs in lint_file option for more details.
Discussed in https://github.com/dense-analysis/ale/discussions/4232
You can see the command that ALE uses at php.vim#L37
By default ALE uses stdin (redirection) for passing the data to the linters but this can be changed by setting the lint_file option to "1". See
:h ale#linter#Define
. Unfortunatelly this change would require changes to ALEs code as this cannot be changed via config and also reading files from disk disables linting while typing. Read the docs in lint_file option for more details.