NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
HOWTO: Debug remote website with PhpED
Site Admin

Joined: 13 Jul 2003
Posts: 8351
Reply with quote
HOWTO: Debug remote website with PhpED

PhpED provides the most comprehensive support for debugging of remote web sites. The functionality includes, but not limited to:
- Debugging current page
- Debuging the next page
- Invoking the debugger after certain number of requests
- Debugging all pages on the site
While debugging of the local scripts takes just one button click, as you can imagine remote debugging is a little bit more involved. You need to know three things to start debugging your website, no matter where it is and where you are running PhpED. You will need to know:
1. How to Install debugger module. http://forum.nusphere.com/howto-install-debugger-module-t576.html
2. How to setup Project Mapping properties (see below)
3. How to run debug session. http://forum.nusphere.com/howto-run-debug-session-t585.html

If you are going to run dbg in ssh please take a look at these two topics:
-How to run debug session through SSH. http://forum.nusphere.com/howto-run-debug-session-through-ssh-t580.html
-Troubleshooting debugger communications/SSH. http://forum.nusphere.com/tip-troubleshooting-debugger-communications-ssh-t581.html


Project properties dialog – Project > Project Properties – includes mapping section. You should make sure that this info is correct if you are going to publish your project on a remote server and to perform a remote debugging of the project.
To define mapping values for a project:
1. Select the project:
· New. Select File > New Project or just right-click on the name of the current workspace, and then choose New Project.
· Existing. Select project in Workspace tab and choose Project > Project Properties or just right-click on the project name in Workspace tab and select Properties.
· Project Properties dialog window will appear.
2. In the Mapping section of Properties tab define:
· Run mode. Select the mode to run your project files in. If you choose System default, the run mode is set according to Run Mode setting in IDE settings
· Root URL. Specify the URL the website you want to debug or run your files on. (for example, http://mywebsite ).
· Remote root directory. Enter the path to a home directory of your server. For example, c:\apache\web.
If your WEB server is running on your local machine, Remote Root and Project Root must be the same. If for example you run Apache, the recommended project root is DocumentRoot directory, or Home directory in case of IIS. URL should be http://localhost/ (or https://localhost/). If your WEB server is running on a different machine, Project Root should be a valid directory on your workstation and Remote Root should be a web server directory where your webserver is keeping the files.
Root URL should be your web server url.

Depending on your project:
2.a) You may want to publish your local files from project's directory tree to server's DocumentRoot using FTP, WEBDAV or SFTP.
PhpED supports all these protocols. Just create an account and put its name in the project properties, publishing account input.
Suppose your server runs on Windows and has C:\myweb\ as DocumentRoot . Also suppose you have copy of all web files on your workstation in directory C:\web. Imagine that you managed to run FTP server on your server and it provides access to Document Root (C:\myweb\) directly (it's FTP root).
In this case project properties are simple:
Project Root->C:\web\
Remote Root->C:\myweb\
Publishing Root->/
URL->http://myweb/

You may want to verify if everything is correct by checking a file in the web's root. (Index.php, for instance). Then this file could be seen as C:\web\index.php on your worstation, as C:\myweb\index.php on your server and as http://myweb/index.php on the network and its content should be exactly the same all the time. That's why you need local-to-remote deployment with an FTP or WEBDAV account..
2.b) You may want to avoid local-to-server deployment and access to server file's direcly. Suppose directories are the same as in the example above. In this case you'd add network share of C:\myweb\ directory on your server and assign a name to it. Say it is named as "webroot".
On your workstation, you'd map it as networking disk. (actually you can access to shared directory by server name prefixed with two slashes but it runs slower). Say, you mapped it as disk Y:\.
In this case you see index.php mentioned above as Y:\index.php on your workstation, as C:\myweb\index.php on your server and http://myweb/index.php via http.
So the project properties should be
Project root->Y:\
Remote Root->C:\myweb\
URL->http://myweb/
The same way this can be done on unix systems using Samba service.
3. In the Mapping tab of Project Properties dialog window you can enter and edit mapping information.
· Remote directory. Enter the path to the remote directory containing your project files.
· Local directory. Shows the path to the local directory containing your project files.
· URL. Enter the URL of your site.
· Publishing directory. Enter the path to the publishing directory.
· Use ADD, EDIT and DELETE to edit the list.
· Use UP and DOWN to move directories in the list top or bottom.
To see calculated mapping for a particular directory, take a look at Folder properties.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
HOWTO: Debug remote website with PhpED
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