date('Y') returns 0000 on big endian machines

Bug #493727 reported by Dennis
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: php5

Problem: date('Y') returns 0000 on big endian machines (instead of 2009)

using: Ubuntu 9.10 on a PowerPC
package: php5
version: 5.2.10.dfsg.1-2ubuntu6.3

It's a known bug in PHP:
http://bugs.php.net/bug.php?id=48276

This page shows a diff to fix it, a one character edit:
http://forums.matrix.squiz.net/index.php?showtopic=6607

This date problem causes serious problems in many PHP applications, even cookies with an expiration date no longer work due to the incorrect year.

Revision history for this message
Chuck Short (zulcss) wrote :

Thanks Ill take a closer look at this.

Regards
chuck

Changed in php5 (Ubuntu):
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Chuck Short (zulcss) wrote :

Can you try the version that is in my ppa when it gets built (launchpad.net/~zulcss/+ppa)

thanks
chuck

Changed in php5 (Ubuntu):
status: Confirmed → Triaged
Revision history for this message
Dennis (dvierkant-hotmail) wrote :

I only see "php5" and "php-pear" in the PPA. If I try to install those I get the following error:

php5:
  Depends: libapache2-mod-php5 (>=5.2.10.dfsg.1-2ubuntu8~ppa1) but 5.2.10.dfsg.1-2ubuntu6.3 is to be installed or
  libapache2-mod-php5filter but it is not going to be installed or
  php5-cgi but it is not going to be installed
  Depends: php5-common (>=5.2.10.dfsg.1-2ubuntu8~ppa1) but 5.2.10.dfsg.1-2ubuntu6.3 is to be installed

php-pear:
  Depends: php5-common (>=5.2.10.dfsg.1-2ubuntu8~ppa1) but 5.2.10.dfsg.1-2ubuntu6.3 is to be installed

Revision history for this message
lechee (lecheel) wrote :

please fix it, my ppc server go down without this patch :-(

Revision history for this message
Dennis (dvierkant-hotmail) wrote :

For what it's worth, I fixed the bug on my own PPC system by doing the following:

# install stuff needed to build PHP5:
apt-get install dpkg-dev build-essential
apt-get build-dep php5

# download the sources:
cd /usr/src
apt-get source php5

#Now apply the diff from: http://forums.matrix.squiz.net/index.php?showtopic=6607

# recompile PHP5:
cd php5-5.2.10.dfsg.1
dpkg-buildpackage -uc -b

# manually install the deb files onto your system, choose all the packages you had installed before:
cd ..
dpkg -i php5_5.2.10.dfsg.1-2ubuntu6.3_all.deb php5-common_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb libapache2-mod-php5_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-cli_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-curl_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-dev_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-gd_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-mhash_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-mysql_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-recode_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-sqlite_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb php5-xsl_5.2.10.dfsg.1-2ubuntu6.3_powerpc.deb

I'm not Ubuntu packaging expert so I'm probably not doing it "the right way". Also, because I didn't change the version number (I don't know how) the update mechanism might try to overwrite it with the old buggy version.

Revision history for this message
lechee (lecheel) wrote :

so much help Dennis I 'll trying build now :-)

Revision history for this message
lechee (lecheel) wrote :

hi after buildpackage need install all dpkg -i ... or just replace /usr/lib/apache2/modules/libphp5.so

Revision history for this message
lechee (lecheel) wrote :

nice done after replace new libphp5.so the great thanks my friend

Revision history for this message
Chuck Short (zulcss) wrote :

This is fixed in lucid. Thanks for the bug report.

Changed in php5 (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.