Advice on Code Debugging

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
User avatar
TheMoose
Forum Contributor
Posts: 351
Joined: Tue May 23, 2006 10:42 am

Advice on Code Debugging

Post by TheMoose »

Check your PHP version first, if you're on a webhost.

I spent about 3 hours googling and searching to try to figure out why my code was returning an error, only to realize that my host inadvertently disabled PHP5 access on me (I sent in a ticket, they fixed it in about 5 minutes). For the past 3 hours I was trying to fix PHP5 code running on PHP4 engine.

I was in the middle of writing a post to ask for help here, when I just decided to make the ol' "phpinfo();" script and see what I could find. First thing I saw was "PHP Version 4.4.7" and was so happy (and angry) that it wasn't an error in the code that I couldn't figure out to save my life.
User avatar
WaldoMonster
Forum Contributor
Posts: 225
Joined: Mon Apr 19, 2004 6:19 pm
Contact:

Post by WaldoMonster »

Add something like this on the begin of the script will save you the above trouble.

Code: Select all

if (version_compare('5.0.0', phpversion(), '>='))
    exit('requires PHP 5.0.0 or higher');
Post Reply