Lampwrights Forum > Linux, Apache, MySQL, PHP > PHP

Thread Tools
07-19-2010, 02:14 PM   #1
Jeff's Avatar
Join Date: Jul 2010
Posts: 402
Rep Power: 10
Jeff is getting browny points
Stepping through live code

Sometimes there is an issue on your site and you need to resolve it in real time. Here is a method I use to step through code so only I see the debug code/breakpoints. Here is a typical breakpoint:

if ($_SERVER['REMOTE_ADDR'] == '') { echo "break"; exit; }
Of course, you need to change the IP address.

I use this method to test configurations or enable settings for just myself. For example, Vbulletin has a debug mode and if I need to debug the live site, I put this at the end of the config file:
if ($_SERVER['REMOTE_ADDR'] == '') { $config['Misc']['debug'] = true; }
Jeff is offline   Reply With Quote



troubleshooting php

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 06:51 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.