Skip to content

Latest commit

 

History

History
36 lines (23 loc) · 1.03 KB

PHPWSL.md

File metadata and controls

36 lines (23 loc) · 1.03 KB

PHP with WSL

With Ubuntu 20.04 LTS as distro.
The goal is to use PHP from windows under WSL, without installing PHP on the linux distro.

Using php.exe with WSL

Editing ~/.bash_profile, add this lines.

alias php='php.exe'
alias phpdbg='phpdbg.exe'
alias composer='cmd.exe /c composer'

Using PHP_INI_SCAN_DIR

Using directory C:\phpini for additionnal ini files, with a php module (PHP ts).

SetEnv PHP_INI_SCAN_DIR "C:/phpini"
LoadModule php7_module <the_module>

With PHP nts, environment variables is required.

  • In Advanced System Setting (fr-FR Paramètres système avancés), click Environment Variables... (fr-FR Variables d'environnement...).
  • In System Variables, add PHP_INI_SCAN_DIR

Sharing environment

In Advanced System Setting, add or extend WSLENV with value PHP_INI_SCAN_DIR/p

More infirmations here : share environment vars between wsl and windows