My development blog about PHP, Nette Framework, ElasticSearch or occasional short tips.
How to enable debugging PHP on Windows which is running in WSL. In few steps.
sudo apt-get install openssh-server
sudo apt-get install php-xdebug
sudo nano /etc/ssh/sshd_config
sudo service ssh restart
Here is remote config button
Here is remote config itself
Set up Path mappings. Your project files to WSL files. Keep in mind you have to specify absolute path, symlinks are not supported.
Configure Xdebug
sudo nano /etc/php/7.1/apache2/php.ini
Add these lines to end. ```` [xdebug] zend_extension=”/usr/lib/php/20160303/xdebug.so”
xdebug.remote_enable=1 xdebug.remote_connect_back=On xdebug.remote_host=127.0.0.1 xdebug.remote_port=9001 xdebug.idekey=PHPSTORM
Restart apache
sudo service apache2 restart ````
Configure debugger in PHPStorm
Use it :)