1
2

More than 3 years have passed since last update.

Phalcon+Vagrant+centos+xdebug+phpstormのデバッグ環境構築

Posted at

1.xdebugのインストール

vagrant ssh
sudo yum install --enablerepo=remi-php72 php-xdebug -y

Xdebugモジュールの場所を確認

sudo find / -name "xdebug.so"

php.iniの編集

sudo vi /etc/php.ini

最後に下記で追記
vagrant の場合はホストは10.0.2.2と設定

[xdebug]
zend_extension=/usr/lib64/php/modules/xdebug.so
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.remote_host=10.0.2.2
xdebug.remote_port=9001
xdebug.idekey="phpstorm"
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp

サーバー再起動

sudo systemctl restart php-fpm
sudo systemctl restart nginx

php.infoファイルを作り、info にはxdebugの設定関連が表示されたら成功

2.phpstormの設定

特に挫折しているので要注意

1.言語設定にリモートを選択
スクリーンショット 2020-09-22 16.21.29.png

2.Debug設定:

スクリーンショット 2020-09-22 16.22.53.png

IDE keyとホストの設定(ホストはvagrant.fileに設定済)
スクリーンショット 2020-09-22 16.23.50.png

3.serverの設定
特に注意するのはフォルダーのパスをマッピングすることで、

スクリーンショット 2020-09-22 16.25.21.png

ローカルのパスはプロジェクトのルートで、publicではない。
スクリーンショット 2020-09-22 16.26.34.png

仮想環境のパスもルートです。
スクリーンショット 2020-09-22 16.27.50.png

4.Debugの設定を完了:
remote debugを設定する
スクリーンショット 2020-09-22 16.28.45.png

起動:
スクリーンショット 2020-09-22 16.35.46.png

1
2
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
1
2