NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Local debugging URL mapping


Joined: 13 Jan 2015
Posts: 2
Reply with quote
I am debugging using the local SRV server. My public directory is

C:\Src\Home\Chip\Web\webv6\tch_chip4_net\pub

I want to load index.php as the initial file. I set

Project Properties > Run Target > Default file: D:\Src\Home\Chip\Web\webv6\tch_chip4_net\pub\index.php (This must be a local path.)

I set the URL mapping to

D://Src//Home//Chip//Web//webv6//tch_chip4_net//pub// to /

When I launch the debugger, it uses the URL "http://localhost:8080/pub/index.php" which is incorrect, because "pub/" is not part of the URL. If the URL mapping does not include "/pub/" the relative paths are not correct. The debugger is not able to find index.php until I manually remove "/pub" from the URL in the browser address bar, then everything works including links to other pages. I need to manually correct the URL every time I start a new debugger session.

How do I set the URL mapping so that it works correctly from the start?

PS: I would upload my screenshots, but postimage.org is broken, generating a server-side error.
View user's profileFind all posts by TeasingDartSend private message
Guru master

Joined: 24 Jul 2009
Posts: 733
Reply with quote
The run Target can be the URL that you want to debug, so it can be http://localhost:8080/index.php

Then the URL mapping assists PhpED and DBG with determining which locally accessible file should be opened when debugging.

The new project wizard normally gets the mapping correct. For a project with the local computer as the web server:

Web document root: D:\Src\Home\Web\webv6\tch_chip4_net\pub
Web root URL: http://localhost:8080
Root directory: D:\Src\Home\Web\webv6\tch_chip4_net\pub

Then change the project properties and set Default file or URL to http://localhost:8080 (I would normally leave off index.php because Apache loads index.php by default)

Because it is a local project with a single directory, no mapping is required. Mapping would be required if the site required PHP files above and outside of the document root.

If you are going to be debugging frameworks or using cookies, bear in mind that technically localhost is not a valid domain name and you might find it causes you problems. Some frameworks do not support cookies with localhost. Once you have got your debugging working, you are possibly best to setup local domain names for debugging. You can use the Windows hosts file to do that.

Also bear in mind that SRV is not a replacement for a 'proper' web server. SRV is great for debugging some PHP projects, but for real web sites you are possibly better using Apache or maybe IIS if you add PHP support (personally I'd use Apache).
View user's profileFind all posts by plugnplaySend private message
Local debugging URL mapping
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic