'php' not recognized as an internal or external command [closed]

-1

I'm encountering this error when saving the file

    
asked by anonymous 20.02.2017 / 21:12

2 answers

1

Causer

According to the comments and the previous answer given by the author of the question it can be seen that the cause of the problem is a kind of linter < what uses the php executable to check for problems within your code, most of them do this to stay consistent on any version of the bike used, running your code and catching the errors.

Problem

As most Linters (and Syntax Chekers, Coding Standards Fixers, Style Checkers, etc.) use some executable to do their tests, they need to be installed in order for them to function, as reported in the previous answer, the problem was caused by the Naomichi- PHP Syntax Checker you can see line 6 of the checker code > in GitHub that it uses a PHP command:

...
EXECUTE_COMMAND = "php -l"
...

This command is used to check for errors in the ONLY code as seen in the PHP manual :

  

-l Syntax check only (lint)

This command is only executed if the php executable exists on your computer and is mentioned in your environment variables.

How to Solve

There are 2 options:

  • Install PHP

    Oops: If even after the problem is installed, make sure your environment variables are leading to the folder containing php.exe . If you do not know how to do this, you can follow .
  • Remove Plugin

    Oops: If even after the problem has been removed, check your plugins, there should be some that use php, they are rare, but some autocompletes can also use.
21.02.2017 / 14:05
0

cool head thinks better, I was with a plugin in the sublime text 3 'PHP Syntax Checker' that I had installed a few days ago and did not remember. I removed it and the no error reappeared.

    
21.02.2017 / 12:27