7

Guide on how to setup XDebug with PHPStorm.

Versions:

  • PHP 7.0
  • PHPStorm 2016.3.2
  • XDebug 2.5
  • OS X El Capitan 10.11.6

1 Answer 1

7

This guide is only for PHP7, Mac El Capitan, PHPStorm 2016.3

  1. Install brew http://brew.sh/
  2. Install php7 brew install php70
  3. Install nginx

    Guide - http://learnaholic.me/2012/10/10/installing-nginx-in-mac-os-x-mountain-lion/

    Config - https://gist.github.com/kmaxat/c07795ab88677efb843686d075fafa9e

  4. brew install php70-xdebug

  5. Create info.php file in public folder of laravel:

    info.php: <?php phpinfo();

  6. Edit file /usr/local/etc/php7.0/conf.d/ext-xdebug.ini

    zend_extension="/usr/local/opt/php70-xdebug/xdebug.so" xdebug.remote_enable = 1 xdebug.remote_connect_back=1 xdebug.remote_port = 9001 xdebug.scream=0 xdebug.show_local_vars=1 xdebug.idekey=PHPSTORM

  7. Restart nginx sudo nginx -s reload or brew services restart nginx

  8. Restart php-fpm brew services restart php70

  9. Go to localhost/info.php, you should be able to see xdebug. Part of the image:

List item

  1. Setup your CLI interpreter. PHPStorm -> Settings -> Languages & Frameworks -> PHP

enter image description here

  1. Click on '...' next to CLI interpreter. If above steps are done properly, you should be able to see this:

enter image description here

  1. Setup Server: Run -> Edit Configurations -> ... (next to server).

enter image description here

  1. Setup Edit configuration Run -> Edit Configurations -> + -> PHP Web Application. Choose created server, set name

enter image description here

  1. In Toolbar select created sever, then click on "Start Listening for PHP Debug Connections".

enter image description here

  1. Set breakpoint at public/index.php

enter image description here

  1. In toolbar click "Debug 'ServerName'"
Sign up to request clarification or add additional context in comments.

3 Comments

Small note: you seems to configure "DBGp Proxy" ... but do not use it in any way. Why trying to configure it then? To confuse those who will read this manual even more (in case if they will have some issues)?
Right! My mistake, fixed it.
By the way since .dev is a legit gTLD it may not work as expected. Here is the first result of relevant Google search link ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.