PHPStorm Evaluation : debugging local apache hosted projects

 Hi,

Not new to PHP but new to PHPStorm (evaluation) and XDebug.

I have a few webs set up locally on apache2. I have xdebug installed. 

I'm tripping at the first hurdle here unsure if I should be debugging as PHP Script or PHP Web App. I set up a Server which is pointing to my local apache2 vhosts (etc/hosts mapping) but breakpoints are not triggering. 

I can however debug as a PHP Script.

My simple "get me going" Q is how should I be configuring the "debug profile" for a locally hosted apache2 vhost?

 

regards

r.

 

0
3 comments

Hi there,

Have a look at these manuals/videos in case if you have not seen them yet: https://confluence.jetbrains.com/display/PhpStorm/Debugging+with+PhpStorm

You may go with https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm

BTW -- what's your OS? On Linux/Mac .. and maybe now on some other XAMPP (and alike) installations you may have 2 different php.ini --

  • one for CLI (e.g. used when you execute script in CLI environment -- in PhpStorm it would be "PHP Script", "PHPUnit" (and alike) types of Run/Debug Configuration (where PHP Interpreter gets involved directly)
  • one used by PHP when run by Apache (Run/Debug Configurations where code is debugged over the browser/HTTP request)

So ... ensure that you are editing right php.ini -- check "php --ini" for list of ini files loaded in CLI .. and "phpinfo();" output when doing via browser.

0

Oh that was silly of me : I forgot to mention I am using Debian testing. Both my php ini files (apache and cli) are pointing to the pecl installed xdebug. I shall check the videos. Thanks for the quick reply.

0

If you will need more help:

1) provide php.ini settings for xdebug

2) phpinfo(); output -- top table + whole actual xdebug section

3) collect xdebug log for such unsuccessful debug session ( https://xdebug.org/docs/all_settings#remote_log ) and provide it here (share via dropbox or alike)

4) ensure that no symlinks in your path (PHP/xdebug work with final/resolved paths while IDE sues them as is). You may need setup path mappings for that.

5) try debugging simple script first (one simple instruction per line). Breakpoints on multi-line statements may not be triggered (as it's hard to guess sometimes at what line in such multi-line construct it must be placed (nuances of PHP internals))

6) screenshots with your settings

Since you can debug CLI scripts just fine (as per your message) then you almost there -- just a thing or two to check/set.

0

Please sign in to leave a comment.