1

I work on Windows 10 with Laravel v5.6, PHP/php-fpm v7.2.4, and Xdebug v2.6.0.

My web site run locally. I installed the add-on Xdebug helper for Chrome and everything is done and configured as mentioned in this tutorial: Laravel Development using PhpStorm

However, Xdebug still can't working or debugging, and Xdebug not working for any reason, even when I click on debug button in PhpStorm, it will redirect me to the correct page but without any debugging.

Does anyone manage to debug Controllers or Models PHP code in a Laravel project and have the same issue?

Here are my Xdebug settings:

php.ini

[xdebug]

zend_extension = c:\wamp64\bin\php\php7.2.4\ext\php_xdebug-2.6.0-7.2-vc15-x86_64.dll
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir ="c:/wamp64/tmp"
xdebug.show_local_vars=0

Problem: The result after run Xdebug, it move me to the right index page with session default values as following:

http://localhost:8000/?XDEBUG_SESSION_START=14610

but without any debugging on PhpStorm or any running process there.

This is my composer.json:

"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.6.*",
    "laravelcollective/html": "5.6.*@dev",
    "yajra/laravel-datatables-oracle": "^7.7",
    "guzzlehttp/guzzle": "^6.2",
    "pusher/pusher-php-server": "^2.3",
    "zizaco/entrust": "1.7.*",
    "laravel/tinker": "^1.0",
    "laravel/dusk": "^1.0",
    "barryvdh/laravel-debugbar": "^2.4",      
    "intervention/image": "dev-master",
    "squizlabs/php_codesniffer": "^3.0",
    "phpunit/phpunit": "^5.7",
    "maatwebsite/excel": "^2.1",
    "league/fractal": "^0.16.0",
    "dompdf/dompdf": "^0.8.0",
    "barryvdh/laravel-dompdf": "^0.8.0",
    "facebook/php-ads-sdk": "2.11.*",
    "facebook/php-sdk-v4" : "~5.0",
    "consoletvs/charts": "5.*",
    "doctrine/dbal": "^2.5",
    "mpociot/laravel-apidoc-generator": "^2.0",
    "darkaonline/l5-swagger": "5.4.*",
    "tymon/jwt-auth": "^0.5.12",
    "splitbrain/php-archive": "^1.0",
    "laravel/cashier": "~7.0",
    "maddhatter/laravel-fullcalendar": "^1.3",
    "gr8shivam/laravel-sms-api": "^2.0",
    "barryvdh/laravel-ide-helper": "^2.4"
},
6
  • 1) Show xdebug section of phpinfo() output. So far the settings you have provided do not give much info. BTW composer.json is not needed for this ... and Laravel 5.6 requires PHP 7.1+ .. so you composer requirements are a bit old... 2) confluence.jetbrains.com/display/PhpStorm/… Commented Jul 17, 2018 at 8:35
  • Try adding ` xdebug.remote_connect_back` setting Commented Jul 17, 2018 at 8:38
  • also you don't appear to have set a port? Commented Jul 17, 2018 at 8:39
  • I tried to more figures to make it more clear, but I couldn't. Maybe because I'm still new here, then I need to get more reputation. Will try to add more details and figure later once I get the enough reputation. Commented Jul 17, 2018 at 9:17
  • At very least change xdebug port to 9001 in both php.ini and PhpStorm settings -- with php-fpm that quite likely will be the issue. Other than that -- collect xdebug log and provide your settings -- even reputation = 1 is enough to edit your own question and provide that info. Commented Jul 17, 2018 at 11:29

1 Answer 1

2

Here's my config:

xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9001
xdebug.remote_autostart=0
xdebug.remote_connect_back=1
xdebug.idekey="PHPSTORM"
xdebug.max_nesting_level = 250

Usually the debug port is 9000, but if you use PHP-FPM the chances are it will already be on port 9000, so that's why I have it set to 9001.

Connect back setting allows you to trigger debugging via a browser bookmarklet or plugin button. Autostart starts a debug session every time, so I leave this off. The nesting level is for var_dumps etc, and lets you see more detail with less dots .... I set the IDE key to PHPStorm, and set it in the IDE too along with the port.

That should be you good to go! Make sure your IDE is actually listening for a connection, and that in your browser via the button or bookmark that you have turned debugging on.

I use a nice XDebug helper for Firefox which toggles it.

Good luck!

Sign up to request clarification or add additional context in comments.

Comments

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.