3
3

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.

Mac OS XでMAMP内のPHPをコマンドラインから実行する

Last updated at Posted at 2016-04-19
  1. ~/.bashrcを開く

    vim ~/.bashrc
  2. 下記を記述

    alias php="/Applications/MAMP/bin/php/php5.6.10/bin/php"

    ※PHP7を実行したい場合はphp5.6.10php7.0.0に変更すること
  3. ~/.bashrcを読み込む

    source ~/.bashrc
  4. コマンドラインからMAMP内のPHPを実行出来ているか確認する

    任意のディレクトリにinfo.phpファイルを作成しphpinfo()を記述。

    コマンドラインから下記を実行する

    php info.php | grep 'Loaded Configuration File'

    これで

    Loaded Configuration File => /Applications/MAMP/bin/php/php5.6.10/conf/php.ini

    と出ていればOK。
3
3
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
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?