Windows 10 + PHP + VS Code 可以捉蟲嘅 Development Setup

我想用一個 Open Source 嘅 accounting software,選咗一隻叫 Akaunting 嘅東西,佢係 PHP,不過用咗隻 Laravel framework,仲加咗些少 Vue JS。安裝 Akaunting 我已經用 Docker 搞掂咗,依家係想改下嘢,進一步就係寫啲 plugins(佢叫 Apps),於是乎就要起隻 development environment 出嚟,所以就有今篇文。

有片睇:

簡單嘅步驟:

  1. Clone Akaunting from GitHhub:git clone akaunting-git-link
    Start VSCode on it
  2. VSCode install PHP Debug extension
  3. Debug installation instruction
  4. Install  XAMPP

    Start Apache & MySQL
  5. Browse localhost
    make sure apache is running
  6. Modify Apache https.conf
    point DocumentRoot to your project folder
  7. Back to your browser

    copy the PHP Info
    paste it into step 3
    click the “Analyse my phpinfo() output” button
    download the generated DLL to your PHP etx folder
  8. Modify your php.ini file with
    [XDebug]
    xdebug.remote_enable=1
    xdebug.remote_autostart=1
    zned_extension = “C:\xampp\php\etx\php_xdebug-…dll”
  9. Modify VSCode settings
    “php.validate.executablePath”: “C\\xampp\\php\\php.exe”

  10. select VSCode DEBUG nav tab
    add PHP launch.json

  11. start debugging with VSCode DEBUG “Listen for XDebug”

其他關聯步驟:

  1. Install Composer
  2. Install Node JS
  3. Install Laravel