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

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

More than 1 year has passed since last update.

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との違いじゃなくて別要因な気もするけど..)

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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした