Big SurでVS-codeからphpunitを動かす

MacをBig Surにしたら不具合発生。

VS-codeのtasks.jsonで設定していたphpunitが動かなくなった。

No tests executed!

と表示される。
このため、原因調査。

調べてみると、標準で入っているPHPが古いバージョンなのでエラーが出るとのこと。

vs-codeのphpは /usr/bin/php にあるものだった。
これをterminalからリネームしようとしてもエラーでできない。
このディレクトリのものは変更できないとのこと。

vs-codeにパスを通そうと
terminal.integrated.env.osx
で設定しようとするも、反映されない。

echo $PATH をしてみると
/bin:/usr/local/bin:/usr/bin
となっているので、
/usr/local/bin に、現在の実行phpである
/usr/local/opt/php/bin/php
へのシンボリックリンクを作成し、そちらの方が先に読まれるようにしたら動いた。

You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

コメントを残す

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

CAPTCHA