PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting

后端 未结 7 2077
没有蜡笔的小新
没有蜡笔的小新 2020-12-24 05:34

I\'m running windows 10 fresh copy and I just installed visual studio code. I was trying to develop a PHP project using VS Code. But I\'m having trouble in setting up the en

7条回答
  •  我在风中等你
    2020-12-24 06:02

    Try this !!!. This will solve your problem for sure!

    Method 1 -

    Step 1 - Go to 'Environmental Variables'.

    Step 2 - Find PATH variable and add the path to your PHP folder.

    Step 3 - For 'XAMPP' users put 'C:\xampp\php' and 'WAMP' users put 'C:\wamp64\bin\php\php7.1.9' ) and save.

    Method 2-

    In VS Code

    File -> Preferences -> Settings.

    Open 'settings.json' file and put the below codes.

    If you are using WAMP put this code and Save.

      "php.validate.executablePath": "C:\\wamp64\\bin\\php\\php7.1.9\\php.exe",
      "php.executablePath": "C:\\wamp64\\bin\\php\\php7.1.9\\php.exe"
    

    If you are using XAMPP put this code and Save.

      "php.validate.executablePath": "C:\\xampp\\php\\php.exe",
      "php.executablePath": "C:\\xampp\\php\\php.exe"
    

    Note - Replace php7.1.9 with your PHP version.

提交回复
热议问题