How to use debugger in other folder than htdocs?

I'm new to PHPstorm and I cant make the debugger to work.

The breakpoint is not stopping execution.

I use MAMP PRO 3.0.7.3.

PHPStorm v8.0.2

PHP v5.6

Xdebug v2.2.5

Enabled Xdebug in MAMP PRO (MAMP configure php.ini)

I also edited the php.ini for PHP v5.6 to:

[xdebug]

zend_extension="/Applications/MAMP/bin/php/php5.6.2/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so"

xdebug.remote_enable=1

xdebug.remote_host=localhost

xdebug.remote_port=9000

xdebug.remote_autostart=1

xdebug.profiler_enable=0

xdebug.profiler_output_dir="/Applications/MAMP/tmp"

I had some issue that the loaded php.ini was not the same as the one under/Applications/MAMP.....

I updated the one in my: /Library... to read the same as the one in the PHPv5.6 php.ini file and then Xdebug registered as the interpreter.

One issue fixed.

Now I get some output in a small terminal below my php-code but the breakpoint I set in the code is just passed by, by the debugger and I do not get any stop in the output browser.

(Yes I have started the Xdebug pluggin for Chrome)

I have managed to get things working if I create a project in my MAMP/htdocs folder and breakpoints are working there.

Two issues fixed.

But I would like to put my projects in other folders.

(say Dropbox to be able to work from other computers when needed)

It seams like PHPStorm only can work with projects in the htdocs folder.

Can someone advice where I enable different folders than htdocs?

Can someone elaborate on what server I am using. (Built in or MAMP)?

MAMP has port 888 and PHPStorm seams to use 63342

In Chrome I get: http://localhost:63342/testproject/test.php when debugging.

This is my first encounter with the PHPStorm and as a new user I was hoping things should be super easy but there have been some bumps on the road.

Can anyone advice?

Regards

Niklas

1 comment
Comment actions Permalink

Hi there,

Xdebug registered as the interpreter

?? This does not make any sense to me.

It seams like PHPStorm only can work with projects in the htdocs folder

Nope -- your assumption is wrong.

Can someone advice where I enable different folders than htdocs?

I may suggest this: 5 Step Tutorial: PHPStorm + MAMP PRO 2...

Other useful links:

Can someone elaborate on what server I am using. (Built in or MAMP)?

MAMP has port 888 and PHPStorm seams to use 63342

In Chrome I get: http://localhost:63342/testproject/test.php when debugging.

Based on URL -- built-in simple web server.

To use your own server you have to create some Deployment entry (check Preferences), configure it (e.g. provide correct URL and paths) and do not forget to mark it as Default for this project -- now IDE will be using that URL when opening your files in browser.

This is my first encounter with the PHPStorm and as a new user I was hoping things should be super easy but there have been some bumps on the road.

It is indeed hard to figure out how this works on your own if you just started using PhpStorm, have not used similar IDE in the past and have not watched/read any videos/tutorials. Links to tutorials and some videos I gave you earlier should be a good place to start .. or look for a more detailed info on certain functionality if you already familiar with IDE to some degree.

0

Please sign in to leave a comment.