Jump to content


Photo

PHP DateStamp Issue

date windows wamp localhost phpinfo

  • Please log in to reply
1 reply to this topic

#1 Michael-T

Michael-T

    Newbie

  • New Members
  • Pip
  • 1 posts

Posted 09 March 2013 - 09:03 AM

First time poster so please take it easy on me. I am developing on a windows 7 machine with WAMP Server running and no configuration changes from the defaults. IIS is turned off.

In my site I have a class method to record actions taken by the user. During this method I obtain a timestamp in unix and save it to the database. On the Dev machine, this works fine but when I put it online I get an error.

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

I traced the issue through the code to this point:

// get date stamp
$date = date_create();
$datestamp = date_timestamp_get($date); // ERROR HAPPENS HERE

 

I have tried this method and the OOP method and works fine locally, but fails on my full server which is a windows server running IIS.

I have painstakenly checked the PHPINFO.php for discrepancies but can't see anything that would affect this setting - any help would be really appreciated.

Kind Regards

Michael



#2 Jessica

Jessica

    This is not my name.

  • Gurus
  • 8,982 posts
  • LocationDallas, TX
  • Age:26

Posted 09 March 2013 - 10:48 AM

Turn on error reporting and set to E_ALL so you can see the error.

Are you sure the servers have the same version of PHP?
My goal in replying to posts is to help you become a better programmer, including learning how to debug your own code and research problems. For that reason, rather than posting the solution, I reply with tips and hints on how to find the solution yourself. See below for useful links when you get stuck.

How to Get Good Help: How to Ask Questions | Don't be a help vampire
Debugging Your Code: Debugging your SQL | What does a php function do? | What does a term mean? | Don't see any errors?
Things You Should Do: Normalize Your Data | use print_r() or var_dump()
Lulz: "Functions should not have side effects." - trq

Please take a look at my new PHP/Web Dev blog: The Web Mason - Thanks!!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com