仮想環境(centos)でxdebugが使えない

実現したいこと

windowsにvirtualboxで仮想環境(centos)を構築しました。
仮想環境での開発でもxdebugを使用できるようにしたいです。

発生している問題・エラーメッセージ

エラーメッセージはありません。
xdebugがブレイクポイントで止まりません。

該当のソースコード

launch.json

json

1{2 "version": "0.2.0",3 "configurations": [4 {5 "name": "Listen for Xdebug",6 "type": "php",7 "request": "launch",8 "port": 9003,9 "pathMappings":{10 "/mnt/hgfs/centos/root": "C:\\centos\\root"11 }12 },13 {14 "name": "Launch currently open script",15 "type": "php",16 "request": "launch",17 "program": "${file}",18 "cwd": "${fileDirname}",19 "port": 9003,20 "runtimeArgs": [21 "-dxdebug.start_with_request=yes"22 ],23 "env": {24 "XDEBUG_MODE": "debug,develop",25 "XDEBUG_CONFIG": "client_port=${port}"26 }27 },28 {29 "name": "Launch Built-in web server",30 "type": "php",31 "request": "launch",32 "runtimeArgs": [33 "-dxdebug.mode=debug",34 "-dxdebug.start_with_request=yes",35 "-S",36 "localhost:0"37 ],38 "program": "",39 "cwd": "${workspaceRoot}",40 "port": 9003,41 "serverReadyAction": {42 "pattern": "Development Server \\(http://localhost:([0-9]+)\\) started",43 "uriFormat": "http://localhost:%s",44 "action": "openExternally"45 }46 }47 ]48}

xdebugの設定

ini

1zend_extension=/opt/remi/php73/root/usr/lib64/php/modules/xdebug.so2xdebug.max_nesting_level = 10003xdebug.start_with_request = yes4xdebug.discover_client_host = true5xdebug.mode = debug6 7 8xdebug.client_host = localhost

試したこと

1.logファイルの出力
こちらを参考にログ出力を試みましたが、logファイルは作成できませんでした。
https://qiita.com/zackey2/items/81b15cab2a3ec29bdd38
iniにxdebug.remote_logの項目がなかったため、以下をそれぞれ試しました。

ini

1xdebug.remote_log = /tmp/xdebug.log2xdebug.log = /tmp/xdebug.log

2.xdebugの設定の変更
以下を追加してみましたが、変化はありませんでした。
xdebug.client_host = localhost

環境

CentOS-7
xdebug 3.1.6
vscodeのphp-debug 1.32.0

コメントを投稿

0 コメント