Skip to content

Instantly share code, notes, and snippets.

@HueJack
Last active January 16, 2020 20:38
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save HueJack/76b0f8ce0c257c2777fac89a878e2396 to your computer and use it in GitHub Desktop.
Save HueJack/76b0f8ce0c257c2777fac89a878e2396 to your computer and use it in GitHub Desktop.
Удаленная отладка xdebug + phpStorm
1. Устанавливаем xdebug;
2. В php.ini включаем xdebug и настраиваем удаленное подключение:
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.profiler_enable = 0
xdebug.remote_enable = 1
xdebug.remote_host = 127.0.0.1 #именно 127.0.0.1, а не localhost, иначе может не сработать
xdebug.remote_port=9000 #смотрим свободный, через netstat -tnlp | grep 900
xdebug.remote_handler=dbgp
xdebug.idekey=PHPSTORM #ключ по желанию
3. Пробрасываем порт
ssh -R 9000:127.0.0.1:9000 username@remote_server
username и remote_server - параметры с которыми подключаете по ssh к серверу.
4. Далее заходим в PhpStorm->Settings->Language&...->PHP->Debug в Debug port вводим значение из xdebug.remote_port
5. В ветке PHP находим Servers, добавляем сервер, вводим NAME - произвольное имя, HOST - адрес сайта или IP, порт оставляете 80,
установив галочку на use path mapping.. выбираем соотствие локального каталога и absolute path on the server
6. После переходим в Edit Configuration на панели отладки и добавляем новый PHP Web Applicatoin. Ставим галочку Single Instance Only
и выбираем сервер.
Все.
@NorthenIrbis
Copy link

не работает

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