This section provides processes and techniques for troubleshooting the debuggers and associated files.
When configuring PHP to use the debugger extensions — either XDebug or the Zend
Debugger — it's important to make sure that you're editing the correct php.ini
file and that you have the correct
for the debugger. To find the full path of the php.ini file your installation of PHP
uses, use the
phpinfo() function in a simple script placed in a Web directory.
Listing 10. Simple phpinfo.php script
<?php phpinfo(); ?>
Alternatively, type the command
php -i | grep "Loaded Conf"
and you'll get a result like
Loaded Configuration File =>
Now that you're sure which php.ini file you need to edit, it's important to get the
zend_extension directive to use for your
installation. Use the
-i method again to find two values:
Thread Safety and
Debug Build. Table 1 can help you determine which one to
use. A common mistake is using
zend_extension when you need
zend_exention_ts, and it's a difficult mistake to catch (at first).
Table 1. Choosing the correct configuration key
|Key name||Thread safety||Debug|
If the debugger doesn't stop at all, most likely one of three issues is occurring:
- The first is that you don't have the extension module set up correctly (see "Use the correct
zend_extensiondirective" for the likely cause).
- If you've verified that the extension is set up correctly, you may not have PDT set up to use the debugger you have installed. If you've selected the Zend Debugger as the debugger for your PHP executable, but have XDebug set up in your php.ini file, you'll get some very unexpected behavior.
- Or it could be a firewall issue. Make sure you have the ports configured in your PHP Debugger preferences your firewall allows (if you have a firewall installed and running).
To install your XDebug or Zend Debugger extension binary in the same place as all your other extensions, use
php -i to find out where you directory is. See Listing 11 for an example from the
php -i command.
Listing 11. Finding the extension directory
... extension_dir => /usr/local/php5/lib/php/extensions/ ...