Help us understand the problem. What is going on with this article?

PHPのリモートデバッグ

More than 5 years have passed since last update.

環境

phpstorm: ubuntu (192.168.87.144)
webサーバー: centos (192.168.87.147)

準備(centos側)

$ sudo yum install php-devel gcc gcc-c++ autoconf automake make
$ sudo pecl install xdebug

手順

  • ubuntuでphpstormの「Run>Start Listen PHP Debug Connections」を選択。
  • centosで/etc/php.d/xdebug.iniを編集し、apache再起動。
/etc/php.d/xdebug.ini
; Enable xdebug extension module
;extension=xdebug.so
;zend_extension=/usr/lib64/php/modules/xdebug.so (64bitの場合)
zend_extension=/usr/lib/php/modules/xdebug.so
xdebug.remote_enable= on
xdebug.remote_handler=dbgp
xdebug.remote_host=192.168.87.144
;xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart = on
xdebug.remote_mode=req
xdebug.dump.GET = *
xdebug.dump.POST = *
  • centosから以下実施
$ PHP_IDE_CONFIG='serverName=192.168.87.144' php -dxdebug.remote_host=192.168.87.144 a.php
  • ubuntuでdebuggerが反応することを確認。

ブックマークレットのurl: http://www.jetbrains.com/phpstorm/marklets/

tukiyo3
好き:レトロ風ゲーム、宗教音楽
https://tukiyo.github.io
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away