Win10上でVisualStudioCodeを使用しています。
VisualStudioCodeの PHP InteliSense 拡張を使う際、
wsl上のphpを用いることはできませんでしょうか。
setting.jsonにおいて、下記のような指定をしてみましたが芳しくありません。
json
1"php.validate.executablePath": "C:\\Users\\ユーザ名\\AppData\\Local\\lxss\\rootfs\\usr\\bin\\php",
*.phpファイルを開くと下記のようなエラーが出ます。
Cannot validate since C:\Users\ユーザ名\AppData\Local\lxss\rootfs\usr\bin\php is not a valid php executable. Use the setting 'php.validate.executablePath' to configure the PHP executable.
json
1"php.validate.executablePath": "/usr/bin/php",
こちらも同様のエラーが出ます。
Cannot validate since C:\Users\ユーザ名\AppData\Local\lxss\rootfs\usr\bin\php is not a valid php executable. Use the setting 'php.validate.executablePath' to configure the PHP executable.
いずれも
PHP executable not found. Install PHP 7 and add it to your PATH or set the php.executablePath setting
ということですので、指定方法が悪いか、そもそも指定できないのだろうと推測しています。
なお、統合ターミナルをwsl bashにしています。
また、wsl自体は正常に稼働しており、apache2+mariadb+php7.1-fpmが動いています。
どうぞよろしくお願いいたします。
追記(4/18)
"php.validate.executablePath"の値に、下記のように
bash -c を加えてみましたが、やはり同様のエラーが出ました。
json
1'C:\\Windows\\System32\\bash.exe -c '"C:\\Users\\ユーザ名\\AppData\\Local\\lxss\\rootfs\\usr\\bin\\php"'
あなたの回答
tips
プレビュー