PHP Vimデバッガー:Apacheの構成
VimでPHPをデバッグするためにVdebugをインストールしようとしています。残念ながら、F5キーを押すと、このメッセージは数秒後に表示されます
Waiting for a connection (Ctrl-C to cancel, this message will self-destruct in
20 seconds...)
No connection was made
私は何をすべきか?
私はグーグルでこれについて検索し、このチュートリアルとこれ(そして他の多くのチュートリアル)に従いましたが、うまくいきませんでした。
Vdebugの指示に従いました。
私はこれを達成する方法がわかりません:
Edit your apache configure file
In your VirtualHost section, set debugger port same as the one in your vimrc:
php_value xdebug.remote_port **9009**
今述べたremote_portは、xdebug.iniやvimrcにあるものとは異なります。下記を参照してください。
現在、/ etc / php5 / apache2 / conf.d /xdebug.iniにあります。
zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.profiler_enable_trigger=1
xdebug.profiler_output_dir=/media/www/xdebugdata
そして私のvimrcで
let g:vdebug_options = {}
let g:vdebug_options["port"] = 9000
XdebugヘルパーChrome拡張機能もインストールしました。IDEの使用はオプションではありません。Vimを使用したいと思います。
私はそれを解決しました、そして今Vdebugは働いています。
PHPでxdebugを有効にするphp.iniファイルを編集し、[モジュール設定]セクションに以下を追加します。
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
zend_extension=/path/to/my/xdebug.so
[debug]
; Remote settings
xdebug.remote_autostart=off
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
; General
xdebug.auto_trace=off
xdebug.collect_includes=on
xdebug.collect_params=off
xdebug.collect_return=off
xdebug.default_enable=on
xdebug.extended_info=1
xdebug.manual_url=http://www.php.net
xdebug.show_local_vars=0
xdebug.show_mem_delta=0
xdebug.max_nesting_level=100
;xdebug.idekey=
; Trace options
xdebug.trace_format=0
xdebug.trace_output_dir=/tmp
xdebug.trace_options=0
xdebug.trace_output_name=crc32
; Profiling
xdebug.profiler_append=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=crc32
やってみて
これですべての準備が整うはずです。Apacheを再起動し、phpinfo()を実行して、xdebug情報が表示されるかどうかを確認します。そうでない場合は、Apache error_log + googleが友達です。
それ以外の場合は、vim内でデバッガーを実行する準備ができています。
ローカルホストからアクセスできるVIMでPHPスクリプトを開きます。Webブラウザーで同じPHPスクリプトを開きます。F5を追加します。VIMの下部に「ポート9000で10秒間新しい接続を待っています...」のように表示され?XDEBUG_SESSION_START=1
ます。次の10秒以内に、URLの末尾にあるブラウザページを更新します。VIMに戻ると、すべての栄光のデバッガーにいます。忘れてはいけない:VIM、プレスでウィンドウを切り替えるためにCTRL- - 。ww
ソース-別のLinuxディストリビューションを参照していますが、Ubuntuに適用されます-
お役に立てれば。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加