Skip to content

Instantly share code, notes, and snippets.

@monaxmp
Forked from VeryaskinMax/phpstorm_xdebug.txt
Created September 17, 2018 12:42
Show Gist options
  • Save monaxmp/bf7bf7b8e4a06675f98592fe13c56546 to your computer and use it in GitHub Desktop.
Save monaxmp/bf7bf7b8e4a06675f98592fe13c56546 to your computer and use it in GitHub Desktop.
Phpstorm xDebug settings
1. в файле /etc/php/x.x/mods-available/xdebug.ini прописываем настройки:
zend_extension=xdebug.so
xdebug.show_error_trace = 1
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
1.1 делаем sudo service apache2 restart если надо
2. в phpstorm Ctrl+Alt+S -> Languages & Frameworks -> PHP -> CLI Interpreter -> "+" -> SSH Credentials (забиваем подключение к ssh, сохраняемся)
3. настраиваем Deployment (SFTP), делаем маппинг
4. скачиваем и устанавливаем расширение для хрома Xdebug helper
5. ssh -R 9000:localhost:9000 username@remote_server_host -p remote_ssh_port
где:
username - логин ssh
remote_server_host - ssh host
remote_ssh_port - порт ssh подключния (обычно 22)
Запустить xdebug через консоль:
php -d xdebug.remote_autostart=1 -d xdebug.idekey=PHPSTORM path/to/script.php
ВНИМАНИЕ! xdebug очень грузит процессор, когда модуль включен, сайт работает медленнее. Поэтому после всех дебагов нужно модуль отключать:
1.sudo phpdismod xdebug
2.sudo service apache2 restart
и включать когда надо:
1.sudo phpenmod xdebug
2.sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment