簡體   English   中英

VScode 中的 Xdebug 不適用於 MacOs 中的“工匠服務”

[英]Xdebug in VScode is not working by 'artisan serve' in MacOs

我正在嘗試在我的 MacO 中調試 Laravel 項目,但它不起作用(Laravel + VScode + Xdebug)。

phpinfo

phpinfo1

phpinfo2

php.ini

;zend_extension="xdebug.so"
[PHP]
zend_extension = /usr/local/lib/php/pecl/20190902/xdebug.so
xdebug.remote_enable = 1 
xdebug.remote_connect_back=1
xdebug.remote_port = 8000 
xdebug.scream=0 

發射.json

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 8000,
            "log": true
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 8000
        }
    ]
}

VScode 編輯器VScode 編輯器截圖

VScode的調試控制台

connection closed
connection closed

在 VScode 的終端上運行php 工匠服務 laravel 項目正在運行,但 Xdebug 沒有像我預期的那樣被觸發。 我不知道是什么問題。 我已經花了好幾次,但仍然無法解決。 任何有過 VScode + Xdebug 經驗的人請幫助我。

感謝您閱讀我的帖子。

它現在正在工作。 在我將“launch.json”的端口更改為 9000 並將“php.ini”更新為“ [xdebug] xdebug.remote_enable=1 xdebug.remote_autostart=1 ”后,刪除了所有舊內容。 最后,運行命令“sudo apachectl restart”。 現在我可以調試我的 laravel 項目。 感謝@LazyOne 的支持

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM