Recently I updated my VS code on my macOS. I’m now running vs code version 1.41.1.
Ever since the reinstall, the phpfmt extension is no longer working and giving me the
phpfmt: php_bin “php” is invalid`
pop up every time I save a file.
I tried removing VS code and installing it again. I removed the extension and reinstalled it as well yet I am still getting this error.
Is there any other settings i can clear. I can’t find this error anywhere online.
5
Answers
assuming you have PHP installed:
Edit your vscode settings (JSON view) add this option:
If you want auto formatting on save:
All Languages:
Just PHP:
you can always check out the plugin page too:
https://marketplace.visualstudio.com/items?itemName=kokororin.vscode-phpfmt
has this bits of info on this + further configuration
happy coding!
On Mac Os:
In the vscode settings (JSON view) extend the ^^ above option with the Mac Os PHP path:
Cheers
Just add below code in
setting.json
inVS Code
in my case the location is in
xampp
so just add yourphp.exe
location.You have to find dir to file php.exe and then you can fig that easily by this way below:
"phpfmt.php_bin": "F:/Xampp/php/php.exe",
F:/Xampp/php/php.exe – my directory