Difference between revisions of "Xdebug"
From zen2
(Created page with "On Ubuntu it's easy, on XAMPP it's not too hard either. For Ubuntu: <pre> sudo apt-get install php-xdebug </pre> Check phpinfo now has mention of xdebug. https://medium....") |
|||
| Line 2: | Line 2: | ||
For Ubuntu: | For Ubuntu: | ||
| − | |||
<pre> | <pre> | ||
sudo apt-get install php-xdebug | sudo apt-get install php-xdebug | ||
| Line 8: | Line 7: | ||
Check phpinfo now has mention of xdebug. | Check phpinfo now has mention of xdebug. | ||
| + | |||
| + | Make sure your php mods-available folder contains xdebug.ini file and this file contains below line: | ||
| + | <pre> | ||
| + | zend_extension=xdebug.so | ||
| + | </pre> | ||
| + | Default xdebug location: /etc/php/7.0/mods-available/xdebug.ini | ||
| + | |||
| + | |||
| + | Now, add below lines at the bottom of your php.ini file: | ||
| + | <pre> | ||
| + | [XDebug] | ||
| + | xdebug.remote_enable=1 | ||
| + | xdebug.remote_autostart=1 | ||
| + | </pre> | ||
| + | |||
| + | Finally restart apache. | ||
| + | <pre> | ||
| + | sudo service apache2 restart | ||
| + | </pre> | ||
| + | |||
| + | Add in the theeasiestxdebug firefox extension. | ||
| + | |||
| + | In VS Code add the PHP Debug extension | ||
https://medium.elegantly.rocks/enabling-php7-xdebug-for-vs-code-on-ubuntu-16-04-e13c5909119b | https://medium.elegantly.rocks/enabling-php7-xdebug-for-vs-code-on-ubuntu-16-04-e13c5909119b | ||
Revision as of 22:11, 22 July 2017
On Ubuntu it's easy, on XAMPP it's not too hard either.
For Ubuntu:
sudo apt-get install php-xdebug
Check phpinfo now has mention of xdebug.
Make sure your php mods-available folder contains xdebug.ini file and this file contains below line:
zend_extension=xdebug.so
Default xdebug location: /etc/php/7.0/mods-available/xdebug.ini
Now, add below lines at the bottom of your php.ini file:
[XDebug] xdebug.remote_enable=1 xdebug.remote_autostart=1
Finally restart apache.
sudo service apache2 restart
Add in the theeasiestxdebug firefox extension.
In VS Code add the PHP Debug extension
https://medium.elegantly.rocks/enabling-php7-xdebug-for-vs-code-on-ubuntu-16-04-e13c5909119b
