7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

flymakeで使われるPHPを変更する方法

Posted at

この記事は次の条件に当てはまる人向けの記事です。

  • EmacsでPHPのコードを書いている
  • flymakeで動的に文法チェックをかけている
  • PHP 5.5以降向けのコードを書くことがある(ジェネレータなど)
  • flymakeが文法チェックに使うPHPのバージョンが古いけど、どこで設定しているのかわからない

Emacs使いなのにflymakeすら使っていない人はEmacsのメリットを出しきれていないと思うので、PhpStormに切り替えるまたはEmacsと併用することをオススメします。ちなみに私自身もPhpStormとEmacsを併用しています。

flymakeが使うPHPのパスを変更する

flymakeが使うPHPのパスは変数値php-executableを利用しています。これをcustomizeで切り替えれば好きなPHPを使うことができます。このデフォルト値は「/usr/bin/php」なので、環境によっては古いPHPが使われてしまうというわけです。

これを変更するには、M-x customizeして、この値を「/usr/local/bin/php」などに設定すれば良いでしょう。僕は単に「php」としました。こうするとPATHから順に探してくれるようです。

蛇足ですが、EmacsのPATHは次の記事のようにinit.elで設定しておくと便利です。

7
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?