• スポンサード リンク

Aptana StudioとXAMPPによる
デバッグの設定方法

本ページの紹介

Aptana StudioとXAMPPを利用して、PHPプログラムをデバッグする場合の設定方法について説明します。

手順

XAMPPの設定 C:\xampp\php\php.iniをテキストエディタで開きます。

以下の箇所を
[XDebug]
;zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
;xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
;xdebug.profiler_output_dir = "C:\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
;xdebug.remote_enable = 0
;xdebug.remote_handler = "dbgp"
;xdebug.remote_host = "127.0.0.1"
;xdebug.trace_output_dir = "C:\xampp\tmp"

次のように全てコメントを外し、xdebug.remote_enableを1にします。
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.trace_output_dir = "C:\xampp\tmp"

Aptana Studioの設定 Aptana Studioを起動します。

ワークスペースをC:\xamp\htdocsにしてOKをクリックします。


ファイル→新規→PHPプロジェクトを選択します。


プロジェクト名を入力して、完了をクリックします。


ファイル→新規→ファイルを選択します。


ファイル名を入力して、完了をクリックします。


PHPファイルを適当に作って保存します。


実行→デバッグの構成を選択します。


PHP Webアプリケーションを選択し、新規ボタンをクリックします。


サーバー・デバッガー:XDebug
ファイル:test/index.php(先ほど作成したPHPファイル)
と入力し、デバッグをクリックします。


以下の表示が出たら、はいをクリックすれば、デバッグ・パースペクティブに切り替わります。


自動でデバッグ・パースペクティブに切り替わらない場合は、ウインドウ→パースペクティブを開く→デバッグを選択してからデバッグを実行します。


最初の行でブレークすれば、デバッグの設定成功です。

※私の環境では、ステップ実行は可能ですが、ブレークポイントでは停止しませんでした。
Pleiades(Eclipse)をインストールしたら、ブレークポイントで停止しました。


スポンサード リンク
    inserted by FC2 system