You are here: Re: [PHP] debugging « PHP « IT news, forums, messages
Re: [PHP] debugging

Posted by Marek Kilimajer on 01/19/05 13:51

Justin French wrote:
> On 19/01/2005, at 5:36 PM, William Stokes wrote:
>
>> I would like to add some debugging/info code to my pages. In test
>> environment of course. Any ideas how to do this? I mean for example to
>> print
>> to a web page the line number when the script fails or something like
>> that.
>> It's a pain on the **s to hunt typo's by just reading the source over and
>> over again.
>
>
> William,
>
> I start by trying to programatically find out if I'm in a development or
> production environment and setting a constant DEV to true or false. For
> me, I development things on my desktop Mac, so the server and client are
> the same machine, and share the same IP address. So my check for DEV is
> if the client IP and server IP match.
>
> <? define('DEV',($_SERVER['REMOTE_ADDR']==$_SERVER['SERVER_ADDR'])); ?>

Interesting. So I just need to use the same hosting server as you do and
your scripts will tell me interesting facts ;)

I use simple define('DEBUG', true'); in the main config file where also
database login info is stored.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация