Setting up xDebug with XAMPP on Windows

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Setting up xDebug with XAMPP on Windows

Postby Devils Child » April 10th, 2013, 12:10 pm

Hello,

I am using XAMPP and PHP Tools for Visual Studio in order to code in PHP. I already configured XAMPP to use xDebug and mod_rewrite. The web site looks OK when I copy everything into C:\xampp\htdocs and call "http://localhost:80". But when I start the solution from Visual Studio (2012) I get Error 310 (ERR_TOO_MANY_REDIRECTS).

The path which is used then is "http://localhost:81". What's wrong with XAMPP/xDebug/PHPTools and how can I fix this?

This is the section of php.ini which I changed:

Code: Select all
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 0
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "C:\xampp\tmp"


If this is not enough information, I will provide more.

Greetings.
Devils Child
 
Posts: 4
Joined: April 10th, 2013, 12:06 pm

Re: Setting up xDebug with XAMPP on Windows

Postby codeowl » April 11th, 2013, 6:22 am

DC,
Is you project setup to use apache, or the built in debugger?
You can verify this by right clicking on the Project in the Solution Explorer of VS and selecting Properties from the context menu. If you want to use apache, you should have the Servers section set to Use Custom Web Server and set the server url to the location of your site.

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: Setting up xDebug with XAMPP on Windows

Postby Devils Child » April 11th, 2013, 4:15 pm

I'm using the option "Use PHP built-in Web Server".
Devils Child
 
Posts: 4
Joined: April 10th, 2013, 12:06 pm

Re: Setting up xDebug with XAMPP on Windows

Postby Miloslav Beno » April 11th, 2013, 4:54 pm

Hi there,
Scott's right. Just change the settings as he said so PHP Tools will use your server instead of the PHP built-in server.

Thanks,
Miloslav
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Setting up xDebug with XAMPP on Windows

Postby Devils Child » April 11th, 2013, 5:01 pm

Okay, I think I got it. However, the directory is empty as my project is not stored in C:\xampp\htdocs, but rather in a different directory. Do I have to manually set up the different directory in XAMPP?
Devils Child
 
Posts: 4
Joined: April 10th, 2013, 12:06 pm

Re: Setting up xDebug with XAMPP on Windows

Postby codeowl » April 13th, 2013, 7:42 am

DC,

I use WAMP and here is my setup:

The WAMP root www dir for websites is:
C:\wamp\www

So I create a sub dir in there for my solution.
Then I have a sub dir inside that for each project.
C:\wamp\www\SolutionName\ProjectName\

I map the Use Custom Server setting the Project Properties in VS to:
http://localhost/SolutionName/ProjectName/

Then you can set the Start Action in the Project Properties to start with a specific page if you want. Even with sub dirs if you want, which is handy for testing, you just right click on a test page in the Solution Explorer and select Set As Startup File from the context menu, and then run the project to go directly there, and then change it back to your index later.

If you are working on an MVC type project you can use a .htaccess in the root of your website (project) dir, to configure the rewrite module in apache if you have it enabled, to get apache to route all requests for php files to your index.php

Hope that helps ;-)

Regards,

Scott (GC)
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am

Re: Setting up xDebug with XAMPP on Windows

Postby Devils Child » April 13th, 2013, 12:46 pm

Okay. I will take a look at WAMP and see if I can get it to work this way.
Thanks for your help.
Also I'd like to say, I really love PHP Tools. Great tool! Keep the good work on :)

Bye
Devils Child
 
Posts: 4
Joined: April 10th, 2013, 12:06 pm

Re: Setting up xDebug with XAMPP on Windows

Postby Miloslav Beno » April 14th, 2013, 10:13 am

Thank you so much, that means a lot to us!
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Setting up xDebug with XAMPP on Windows

Postby codeowl » April 14th, 2013, 10:49 pm

DC,

You may find some benefit in looking at this post:
viewtopic.php?f=21&t=991&p=4574&hilit=WAMP#p4581

It outlines the process I went through to get a WAMP environment setup for debugging with PHP Tools ;-)

Regards,

Scott
codeowl
 
Posts: 51
Joined: February 10th, 2013, 10:05 am


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 46 guests

cron

User Control Panel

Login

Who is online

In total there are 46 users online :: 0 registered, 0 hidden and 46 guests (based on users active over the past 5 minutes)
Most users ever online was 256 on March 28th, 2024, 9:42 am

Users browsing this forum: No registered users and 46 guests