LoginSignup
3
6

More than 5 years have passed since last update.

nginx+php7.0+xdebugインストールではまったこと

Posted at

PHPのデバッグ用拡張モジュール「Xdebug」をインストール。
色々試行錯誤したあとの備忘録です。

ホスト:MacOSX Sierria(10.12.5)
サーバ:Ubuntu 16.04
(VM上で動作)

①Xdebugインストール
peclでインストールしてみたけれどnginxでは動いてくれんかったのでapt-getで再インストール

1.apache

# pecl install xdebug

2.nginx
# apt install php-xdebug

(原因までは調査してない。peclインストール後、phpinfo()の結果にxdebugの項目が存在していないならapt-getでインストールしてみてもいいかも)

②php.ini修正

いわゆる
zend_extension=xdebug.so
xdebug.collect_vars=on
xdebug.collect_params=4
xdebug.dump_globals=on
xdebug.dump.GET=*
xdebug.dump.POST=*
xdebug.show_local_vars=on
xdebug.remote_enable = On
xdebug.remote_handler = dbgp
xdebug.remote_port = 9003
xdebug.idekey = "netbeans-xdebug"
xdebug.remote_host="192.168.0.11"
xdebug.remote_autostart=off
xdebug.remote_mode=req
を書くファイル

1.apache
php.ini
(/usr/local/php/lib/php.iniとか/etc/php5/apache2/php.iniとか)

2.nginx
/etc/php/7.0/mods-available/xdebug.ini

あと、apacheでは

zend_extension=[xdebug.soのフルパス]

nginxでは
zend_extension=xdebug.so

じゃないと動いてくれんかった
(nginxとapacheとの違いじゃなくて別要因な気もするけど..)

3
6
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
6