PHP 5.2.10 in Security Update 2009-005 / PPC breaks date handling

Posted to feedback and reported to Apple support. Here's the deal, Security Update 2009-005 upgrades PHP from 5.2.8 to 5.2.10. Unfortunately, PHP 5.2.10 has a KNOWN bug on PPC (and other architectures) wherein a call to the date() function returns "0000" for the year. This breaks a WHOLE BUNCH of stuff (like all of my web apps in my case). It's a serious problem and this never should have shipped. Hopefully, it will be fixed soon.

MacBook Pro 2.53 GHz (Unibody)/4 Gig RAM/250 Gig 7200 HD, Mac OS X (10.5.8)

Posted on Sep 11, 2009 1:21 PM

Reply
29 replies

Sep 21, 2009 11:49 PM in response to George Qualley

I've just tested this on our PPC G5 xserve running Mac OS X Server 10.5.8 (Build 9L30) with security update 2009-005 applied and, for me, the PHP date function year appears to work ok. I hope this helps. john

PHP:

<?php
echo "date('Y')=".date('Y').'<br />';
echo "date(Y)=".date(Y).'<br />';
echo "date('d/m/Y')=".date('d/m/Y').'<br />';
?>

Results:

date('Y')=2009
date(Y)=2009
date('d/m/Y')=22/09/2009

Oct 2, 2009 8:23 PM in response to George Qualley

G'day ,

I have this problem on all our PPC servers. WebMail (SquirrelMail) is sending emails with the wrong dates 0000, and affected all our custom PHP scripts.

I think this is a big issue, as all PHP driven solutions from Apple will report wrong dates.

Is Apple still supporting PPC?

I remember an early update for Mac OS 10.5 server that had problems with people saving PhotoShop files over the network, you couldn't open the files again. I think Apple took 2 weeks to fix, but it was quickly done, lets see how long they take for this.

Cheers,

Arthur

Oct 15, 2009 11:07 PM in response to George Qualley

I also reported this thru the feedback page 2 days ago,
Heared nothing since 😟
Because of this date('Y') issue records in my databases are screwed too ...


Use this to test :

g41058:~ eddieb$ cat test.php
<?php
echo "date('Y')=".date('Y').'<br />';
echo "date(Y)=".date(Y).'<br />';
echo "date('d/m/Y')=".date('d/m/Y').'<br />';
?>

result on PPC G4
g41058:~ eddieb$ php test.php
date('Y')=0000
date(Y)=0000
date('d/m/Y')=16/10/0000


result on INTEL MBP
intel1058:~ eddieb$ php test.php
date('Y')=2009
date(Y)=2009
date('d/m/Y')=16/10/2009


waiting on Apple

Oct 16, 2009 9:06 AM in response to eddieb-klok-nl

Yep, it's an endian related problem: Intel is big endian and PPC is little endian (or vice versa, I can't remember which) which is why the issue manifests itself on one architecture and not on the other. Apple SHOULD have known about this bug before they rolled this version of PHP into the OS. That said, I'm surprised that this kind of bug EVER made it into PHP in the first place...

Oct 16, 2009 11:31 AM in response to AndySghjghj

Well, this one is definitely taking some time and there really shouldn't be a reason why wrapping up another PHP version SHOULD take this long. I mean, it's not integrally tied to any other system components (that I know of). If it were, the manual build which I did probably would have screwed something, which it did not.

I know that OS X server isn't the most up-to-date system in terms of the underlying component software and generally speaking, I don't think that's a horrible thing. I think there's probably as much risk in running the latest and greatest (perhaps more) as there is in running a few revisions behind the bleeding edge. However, when it comes to something like this, I have to agree that the inability to simply roll up a patch and get it out the door in short order, is a big problem. If I didn't know how to roll my own PHP, I would have been in a WORLD of HURT over this issue.

Personally, I did everything I possibly could to make Apple aware of this issue: I posted on this forum, reported the issue to bugs.apple.com, and asked a server support rep to escalate the problem to engineering. In each case, I gave a SPECIFIC and detailed description of the issue, even including a reference to the PHP bug number. It has been several weeks now and there has been no response.

That, my friends, is a problem.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

PHP 5.2.10 in Security Update 2009-005 / PPC breaks date handling

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.