phpstorm laravel xdebug

Answered

Greetings. 

I have been trying to setup the xdebug debugger tools in phpstorm to work with my laravel project. It is very hard to find any kind of configuration information for laravel, phpstorm, and xdebug. With the information I have found I have configured my settings but when I run the debug I keep getting the public\index.php it never gets past that.

I am using ampps as my server, it is all on localhost so i am running everything on the same pc.

This is how i have things configured currently 

Under build>execution>deployment

http://i38.photobucket.com/albums/e119/dcaldessa/deploymentserver_zpsm6yyvehc.jpg 

php>servers

http://i38.photobucket.com/albums/e119/dcaldessa/deploymentserver_zpsm6yyvehc.jpg 

and xdebug validation

http://i38.photobucket.com/albums/e119/dcaldessa/deploymentserver_zpsm6yyvehc.jpg 

as I have said from what I have found information wise I have everything set correctly but it still is not getting past the public\index.php when listning for a debug event. 

Any guidance would be helpful in getting this resolved so that I can continue on my project with a proper debug setup..

thanks

dwisenbaugh



 

6 comments
Comment actions Permalink

Apologies, your links are pointing to the same image. 

Could you please attach a screenshot of your mappings tab? You can just attach image right here

0
Comment actions Permalink

This is the mappings i currently have, I believe i got it working by taking off break at the first line in php scripts  on the run menu ,force break at the first line when no path mapping is specified and force break at first line when a script is outside the project. 

 

So changing those settings I am able to get past the index.php and into my break point but as i am stepping through im still getting the no map path found for file outside the project even though that it is mapped

 

and I have the laravel folder mapped 

 

 

Which still makes it hard for me to properly debug my project,  any other insights would be great to get this issue resolved.

 

thanks 

 

D

0
Comment actions Permalink

Is your project fully local? Any symbolic links/junction points/mapped drive in that path?

If local and no links ... then try with "Use path mappings" option turned off -- it's needed only for remote or if symlinks are used.

When looking at your screenshots -- even if you use path mappings ... then single mapping at project level (top folder) should do the job -- all subitems (files and folders) are inheriting the path from the parent.

In any case:

P.S. Random thought: maybe you accessing the site using different domain name etc? Can you verify with your browser's Dev Tools (Network tab) that all requests to this site are going through the same/correct domain name.

0
Comment actions Permalink

Yes my project is fully local the web server Ampps and project are running on the same pc through local host.

I made the change and turned off path mappings, debugging still worked but still got the error about path mappings for vendor\laravel being outside the project. 

I have attached below my xdebug settings and the log.

Here is a link to the xdebug log on my google drive. https://drive.google.com/file/d/0B8ag2OlCUWXpM1Rxc2xndDcxUU0/view?usp=sharing 

 

thank you for the help so far hope we can figure every thing out soon. 

 

D

0
Comment actions Permalink

I've looked at the log .. and I could not see anything wrong. I have no idea why IDE shows you that "file is outside the project" warning -- based on your screenshot it should not be showing you that.

I've extracted all the file paths and sorted them in A-Z order removing duplicated (Notepad++) .. and I see nothing wrong with the paths -- I see no obvious reasons why one of them should be reported as "outside one":

D:/Ampps/www/dracanon.dev/app/Helpers/RedirectHelper.php
D:/Ampps/www/dracanon.dev/app/Http/Controllers/Auth/ActivationKeyController.php
D:/Ampps/www/dracanon.dev/app/Http/Controllers/Auth/ActivationKeyController.php
D:/Ampps/www/dracanon.dev/app/Http/Middleware/RedirectIfAuthenticated.php
D:/Ampps/www/dracanon.dev/public/index.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Routing/Controller.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Routing/Route.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Routing/Router.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php
D:/Ampps/www/dracanon.dev/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php
D:/Ampps/www/dracanon.dev/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php

Technically it all looks pretty fine to me (I see nothing obvious wrong).

So far it could be either xdebug itself (less likely) or some weird project settings (some sort of  conflicting parts that lead to confused debugger)

I say:

1) Upgrade your xdebug: to either 2.4.1 or even latest 2.5.5.

2) What's your IDE version? If it's not latest stable (2017.1.4) but some older one (e.g. 2017.1.3 or older) -- please try updating to latest stable

3) What do you use for deployment (I mean -- do you have any Deployment entries defined for this project)?

4) If you have deployment -- try disabling "Detect path mappings from deployment configuration" option at "Settings/Preferences | Languages & Frameworks | PHP | Debug --> Advanced Settings"

5) Anything interesting in idea.log file (Help | Show Log in...)?

6) If still the same -- maybe it's something wrong with the project settings. Do this: 1) Close IDE 2) locate .idea subfolder (contains this project settings -- will be PROJECT_ROOT/.idea) 3) Backup and delete that folder 4) Open IDE and using "Open" point to the project root -- it will create brand new project from those existing files -- configure it as needed and try to debug again.

 

1
Comment actions Permalink

I backed up and re created the .idea file and re setup the project, tested the debugging and everything seems to be working now !! Not sure what was going on with the old configuration but it all seems to be working now. 

 

Thank you for your assistance If i have anymore questions or issues ill post again.

 

D

1

Please sign in to leave a comment.