STERFIELD
開発ナレッジ2020.05.14

PHPSTORMでVagrantをxdebugする

概要


何回もやるはめになったことがあるので議事録として掲載

手順


※前提:PHPのバージョンが5.6の場合
Vagrant上で下記コマンド実行
sudo pecl install xdebug-2.5.5

/etc/php.iniに下記を追加
zend_extension=/usr/lib64/php/modules/xdebug.so

[XDebug]
xdebug.remote_autostart=On
xdebug.remote_enable=On
xdebug.remote_host=192.168.33.1 #最後が1なのがポイント
xdebug.remote_port=9001
xdebug.remote_log=/var/log/xdebug.log
xdebug.remote_mode=req
xdebug.idekey=PHPSTORM
xdebug.remote_handler=dbgp

下記コマンドを実行してphp.iniを読み込ませる
sudo service php-fpm restart

あとはPHPSTORMの設定を下記の通り設定して完了。簡単これだけ。
https://qiita.com/atchy@github/items/2a3ece955a50d4dace8e

WRITER

スターフィールド編集部

この著者の記事を見る

CONTACT

記事の内容について
相談したい方へ

実際の進め方は、状況を伺ってからご提案します。

2営業日以内にご返信します
資料ダウンロード無料相談に申し込む