如何建立PHP偵錯環境(以XAMPP與VS Code為例)v5

[使用WP Githuber MD – WordPress Markdown 語法編輯器,外掛]

https://www.apachefriends.org/index.html

https://code.visualstudio.com/

https://xdebug.org/

下載並安裝 XAMPP

  • phpinfo()

下載並安裝 Visual Studio Code

  • 延伸模組
    • PHP Debug
  • 設定 (注意JSON特殊字元)
    {
        "php.validate.executablePath": "C:/xampp/php/php.exe",
        "php.debug.executablePath": "C:/xampp/php/php.exe"
    }

    下載 XDebug

    • PHP Version
    • 8.1.6 = PHP 8.1
    • Architecture
    • x64 = 64 bit
    • x86 = 32 bit
    • Thread Safety
    • enabled
    • disabled

設定 XDebug

  • C:\xampp\php\php.ini

    zend_extension="C:\xampp\php\ext\php_xdebug-3.1.4-8.1-vs16-x86_64.dll"
    
    xdebug.mode = debug
    xdebug.start_with_request = yes
    • C:\xampp\htdocs
    • menu.php

Leave a Comment

Scroll to Top