Skip to content

Instantly share code, notes, and snippets.

@massiws
Created November 18, 2020 16:26
Show Gist options
  • Save massiws/5604e829474c7426d8370237ba2e2d3f to your computer and use it in GitHub Desktop.
Save massiws/5604e829474c7426d8370237ba2e2d3f to your computer and use it in GitHub Desktop.
Devilbox config for PHP/MySQL/xDebug in VSCode
; Disable ONLY_FULL_GROUP_BY MySQL option in Devilbox
;
; Add a file cfg/mysql-X.Y/custom.cnf (or any filename with .cnf extension)
; make sure to fit your "X.Y" MySQL version!
[mysqld]
sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"
; ----------------------------------
; Xdebug settings for Linux
; ----------------------------------
xdebug.default_enable = 1
xdebug.profiler_enable = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_port = 9000
; The Linux way
xdebug.remote_connect_back = 1
xdebug.idekey = VSCODE
xdebug.remote_log = /var/log/php/xdebug.log
; Optional: Set to true to always auto-start xdebug
xdebug.remote_autostart = false
; vim: set ft=dosini:
; ----------------------------------
; Xdebug settings for Windows (WSL2)
; ----------------------------------
xdebug.default_enable = 1
xdebug.remote_enable = 1
xdebug.remote_port = 9000
; The Windows way
xdebug.remote_connect_back = 0
xdebug.remote_host = IP_ADDRESS(*)
xdebug.idekey = VSCODE
xdebug.remote_log = /var/log/php/xdebug.log
; Optional: Set to true to always auto-start xdebug
xdebug.remote_autostart = false
; vim: set ft=dosini:
(*) To get IP_ADDRESS open terminal and run `ipconfig`: the correct address is "IPv4 Address" in "vEthernet (WSL)" section
@massiws
Copy link
Author

massiws commented Nov 19, 2020

IMPORTANT: make cnf files read only:

cd devilbox/cfg/mysql-X.Y/
host> chmod 0444 *.cnf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment