XDebug is an excellent debugging solution that will give you a more detailed indication of what is wrong in your code. Here is an example of trying to divide two variables that have a value of 0.
- Get XDebug (RC3) to match my php (Windows, 5.1.4) – http://xdebug.org
- Put it into a directory that you can remember, for example, I put it into my PHP directory at C:\php5\
- Open your php.ini file and enter the following lines. If the zend_extension_ts value has been set elsewhere then comment this out.
[xdebug] xdebug.remote_enable=1 xdebug.remote_host="localhost" xdebug.remote_port=9000 xdebug.remote_handler="dbgp" zend_extension_ts="C:\php5\php_xdebug-2.0.3-5.2.5.dll"
- Restart your Apache server and run phpinfo() to see if the instillation has taken.
You will now be able to see detailed output for each of your errors.
Remember that these errors still follow the same rules as normal errors. You must still turn on the display_errors directive and set the appropriate error reporting level to get PHP to display any errors at all.