Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

More than 5 years have passed since last update.

Homestead+PHPStromでデバッグする

Last updated at Posted at 2019-09-17

※殴り書き

vagrant ssh する

php --version を実行する

with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans

が表示されればOK。表示されない場合、 sudo phpenmod xdebug を実行し、再度 php --version する

sudo vi /etc/php/7.3/fpm/conf.d/20-xdebug.ini で、一番下の行に、

xdebug.remote_autostart = 1

を追加

php-fpmを再起動する。

sudo service php7.3-fpm restart

PHPStromの右上に表示されている電話のアイコンimage.pngを緑(画像の状態)にする
※xdebugからのデバッグ情報を受けるために9000番ポートでの待ち受けが開始される
※PHPStormを多重起動している場合、デバッグしたいヤツ以外は緑じゃなくすること

http://localhost:8000 へアクセスするとPHPStorm側でダイアログが出るので、Accept する
File > settings > Languages&Frameworks > PHP > Servers に homestead.test が表示されているので、
ホスト側のローカルパス("c:\hogehoge.."が表示されている所)の右側の "Absolute path on the server" を選択し、 /home/vagrant/code (VM内のLaravelコードのパス)とする

で、ブレーク張るとブレークするようになるはず。。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?