How to setup local PHP debugging with Chromium PHPStorm and Xdebug

Install Xdebug

1. Get phpize:  sudo apt install php7.0-dev

2. Get Xdebug, goto http://xdebug.org/find-binary.php and follow the instructions.

3.Edit two php.ini file:

sudo gedit /etc/php/7.0/cli/php.ini,

sudo gedit /etc/php/7.0/apache2/php.ini

add the text below:

;xdebug configuration

zend_extension = /usr/lib/php/20151012/xdebug.so

xdebug.remote_host = 127.0.0.1

xdebug.remote_enable = 1

xdebug.remote_port = 9000

xdebug.remote_handler = dbgp

xdebug.remote_mode = req

xdebug.idekey=PHPSTORM

Install Xdebug helper extension

1. In the chrome menu, goto settings and select extensions menu

2. serach for "xdebug helper" keywords get the extension

3. click "add to chrome" button to install

Config Xdebug helper

1. right click xdebug helper icon select options

2. For the "IDE key" section, select phpstorm and save

Config phpstorm

1. Goto File->Settings->Languages & Frameworks->PHP, set Development Eviroment.

1. GotoFile->Settings->Languages & Frameworks->PHP->Servers, set local server.

1. Goto File->Settings->Languages & Frameworks->PHP->Debug, set simultaneous connections to 3

2. Goto File->Settings->Tools->Web Browsers, set default browser(For example:chrome).Edit Path for chrome to the location of the excute file(For example:/usr/bin/chromium-browser)

3. Goto Run->Edit Configurations, click + button select "php build in web server", set Name Host Port and save.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容