NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Re: I looked for php.ini in my apache directory but not ther


Joined: 25 Jul 2006
Posts: 28
Location: Germany
Reply with quote
Hello Janice,

in the beginngin I've stumbled across the same questions you have, so here's my try to sum up the steps I went through to have the debugger running fine on my WinXP, hope this helps a little. Smile

With the recent posts there's been some confusion to what kind of form you had Apache installed, e.g.
* Apache as standalone installation
(which might install itself directly into "c:\apache" root directory)
or
* as part of an Apache/MySQL/PHP "package"

One of these "packaged" solutions Dmitrie was referring to is called "XAMPP" (a freely available distribution for Windows) which installs into a "xampp" called directory to your specification.

Just lets assume for now as an example that you had indeed installed XAMPP:

In the case of being part of a "packaged" solution, any configuration files related to Apache and/or PHP are coming "pre-configured" and reside somewhere in that directory structure where you installed it. So any existing "php.ini" file in "c:\windows" is destined to interfere with your installation and should therefore at least be renamed to "php.ini.old" (example) or removed.

In the case of XAMPP this "somewhere" location of the "php.ini" file is the xampp\apache\bin directory (which has precedence over the file "xampp\php\php.ini").

For debugging on a local WinXP platform I have the following lines in it (note that I use my laptop's static local IP address instead of "localhost", depends on whatever works best with your Apache):

Code:
[debugger]
debugger.enabled=on
debugger.profiler_enabled=on
debugger.hosts_allow=127.0.0.1 mywebserver
debugger.hosts_deny=ALL
debugger.ports=7869, 10000/16


There is most likely also a "Zend" section below, so comment out all entries there (putting ";" in front of each line).

Moving on to the phpEd debugger files installation:
Note: the target directory depends on the "extension_dir=" in php.ini, for example:
Code:
extension_dir = "e:\xampp\php\ext\"


There should be a larger list of "extension=" entries in the php.ini.
In case of a PHP v5.1 version add this line below the existing entries:
Code:
extension=php_dbg.dll-5.1.x


This name has to exactly match the name of the to-be-used file, specific for your PHP version.
It is safe to just copy over all files from the phpEd directory "phped\debugger\server\Win32\i686"
into the e.g. "e:\xampp\php\ext\" directory (adapt this accordingly).

When you have applied these changes and saved the php.ini file, I'd recommend to copy it afterwards into the "xampp\php\" directory as well in order to have the same configuration under any circumstance.

One more hint about Apache on WinXP (SP2):
for XAMPP it is highly recommended to add below line to your Apache configuration file
(for my example here located in "xampp\apache\conf\httpd.conf") or otherwise you might not be able to open anything in your browser:
Code:
Win32DisableAcceptEx


You should stop and restart Apache after having applied any configuration changes (either using the "Services" control panel or some batch files).

phpEd project mapping example
I'll stick to my example using XAMPP and static IP address, so please adapt my example to your environment accordingly.
Project
Root directory: e:\xampp\htdocs
Mapping
Run mode: HTTP mode (3rd party WEB server)
Root URL: http://mywebserver/
(this should be "http://localhost/" normally, doesn't work for me, though)
Remote root directory: e:\xampp\htdocs
Files
Default file to run: e:\xampp\htdocs\index.php
Replace this with the "entry" point of your website/php program you'd like to debug.
For example if you would like to debug a content management system residing in a subfolder "cms" with startpage "mycms.php", the entry would be: "e:\xampp\htdocs\cms\mycms.php"; or "e:\xampp\htdocs\phpmyadmin\index.php" if you'd be up to debug phpMyAdmin, you name it... Smile

Some other hints
Menu Tools|Settings, branch Tools|Debugger
The default values set by phpEd should work in most cases.
In my case, as I don't use "localhost", I activated the "Use custom port..." option and set "Debugger host" to my static IP address, leaving the port as it was (7869).

Depending on your debugger usage, the "Stop on first line after run" option may be better deactivated if you will debug one php file not directly tied to your start page, e.g. you'd need several clicks from the start page to get to your functionality you'd like to debug.

In case I made any mistakes, Dmitrie hopefully will point these out, thanks. Wink

Best regards,
Tobias
View user's profileFind all posts by condev1972Send private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8340
Reply with quote
everything is quite correct Smile

Quote:
this should be "http://localhost/" normally, doesn't work for me, though

Check hosts file in C:\Windows\system32\drivers\etc\ directory.
There should be an entry like this
127.0.0.1 localhost

Also check if Apache listens on 0.0.0.0:80 by running command below
netstat -nao TCP
Apache's line may look like this
Proto Local Address Foreign Address State
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING

If it listens on anything other than 0.0.0.0, it's the reason why it is not reachable at localhost. In this case you have check and adjust bind and/or listen directives in httpd.conf file.


Quote:
In my case, as I don't use "localhost", I activated the "Use custom port..." option and set "Debugger host" to my static IP address

If you place there clienthost (a keyword recognized by debugger) or uncheck "Use custom", debugger will recognize the address automatically. But it does not make any sense for local debugging. Both ways work equally good.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Don't Understand HOWTO: Set project 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 2 of 2  

  
  
 Reply to topic