Actually I've just realised that whilst I've got an interpreter set up for the CLI under Settings-Languages +Fworks-PHP -CLI Interpreter, its using a different one when I run php -i in the Terminal...?


Hi there,

What exactly you are trying to debug (what script)? How do you normally run such script?

Why not use "PHP Script" type of Run/Debug Configuration and start debug from there? Works fine for me (Laravel commands).


>its using a different one when I run php -i in the Terminal...?

You may have more than one PHP on your system. Try setting up another as yet another Interpreter in PhpStorm settings and use it (if that's what you need).


I'm trying to break into the bin/magento  (I guess its some kind of exe)  I'm not sure if its compiled with no symbols in but I can get a call stack (showing code I can see) if I run in verbose mode - so its not really my script.

Re php version in terminal , I did remove another version from the Settings-CLI Interpreters page but still the Terminal seems to keep clinging to a different (older) php version/ini.

Can I force the Terminal to pick up a specific interpreter? 


>Can I force the Terminal to pick up a specific interpreter? 

Put the right path before another one into PATH variable (OS level)


>I'm trying to break into the bin/magento

Hmm .. why into such framework code?

>(I guess its some kind of exe) 

No -- AFAIK it should be ordinary PHP file and not some native executable.


So ...  create a "PHP Script" type of configuration and point to that script. Then use Debug button (and ensure that you have breakpoints there .. if you want to debug that particular file). NOTE that such file MUST be recognized as PHP file in PhpStorm in order to have breakpoints etc.


This is really spooky but if you notice I've put the php path at the top :

But the Terminal php -i command is showing this (after reboot x2!):


Try "where php" (in both built in terminal and standard one) to see actual executable used (its location).


About paths... It's likely that PATH from actual user overrides system one (which make sense overall). So check that as well...


Thanks!!! You were right it was the system path holding it - my mistake. Its now entering break mode ...unfortunately that didn't cure the bin/magento which is throwing an exception but at least I can step into the code, i was praying it was a php version issue...


Please sign in to leave a comment.