LoginSignup
0
0

More than 5 years have passed since last update.

Windows7 PHP+Xdebug+Chrome+XDCデバッグ環境

Last updated at Posted at 2017-06-15

環境

今回試した環境
Windowws7 Pro 64bit
Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.8
Xdebug php_xdebug-2.5.4-7.0-vc14.dll
XDebugClient Version:1.0 beta 3
Apahe、Chrome、XDCはすべて同じPCで動作させる。

インストール

Xdebug dll Download XDEBUG EXTENSION FOR PHP | DOWNLOADS
XDC Download Google Code Archive XDebugClient
Chrome Extension Xdebug helper

PHP,ApacheはXAMPPでインストールした。
phpinfo()などでDebug Build→noを確認しておく。
Xdebugのdllは、動作しているPHPに合わせる(32bitか64bitかはOSによらない)。
私の環境はThread Safety enabledなので"_TS"付き(ファイル名は"-nts"無し)をダウンロード。
XDCは最新の物をダウンロード、適当なディレクトリに展開しておいた。
Xdebug helperをChromeに追加。

設定

php.ini

php.iniにzend_extensionを追加。私の環境はdllを C:\xampp\php\ext(デフォルトのextensionのディレクトリ)に置いたため、フルパスの記述は必要ないので
zend_extension=php_xdebug-2.5.4-7.0-vc14.dll
を; Dynamic Extensions ;のコメントのあるブロックの最後に挿入。

根拠は無いが、Extensions の最後に読み込ませたいので、この位置。
PHP5.4以降はzend_extension_TSやzend_extension_debugではなく、zend_extensionにするようだ。

Apache再起動

ここまでで、Apacheを再起動

IDE Key

phpinfoで項目xdebugを確認。IDE Key→gdbpになっているはずなので、ChromeのXdebug helperアイコン右クリック->オプションを開きIDE Key をそれに合わせて Other gdbp に変更。

デバッグ

XDCを立ち上げ、Debug->Start listeningしておく。
Chromeでデバッグしたいローカルサイトのページを表示し、Xdebug helperのDebugをアクティブにしてからリロード。
XDCにソースが表示され、先頭行で停止する。

0
0
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
0
0