Home > 記事 > 紀元前のWordPress(2)

紀元前のWordPress(2)

ただひたすらに調べまくる。先日の調査は生温かったので、今度はきっちし追求。

WordPress, PHP , PHPのライブラリ、MySQL、DBの内容…全部しらべた結果、PHP の date(), gmdate() で ‘Y’ (4ケタ年号)を使った場合に問題となることが発覚。

PHPのBTSを見てみたところ、あった.PHP Bugs: #48276: date(‘Y’) returns 0000がそうらしい。

PHP 5.3.0RC2と、PHP 5.2.10あたりのバージョンで、アーキテクチャが PPC だと発現するようだ。そして今の環境は、PowerPC の Mac mini に、Leopard 付属の PHP 5.2.10。うん、あっている。

解決方法としては、こんなところかな。上のものほど根本的な解決。

  1. Apple がなおしてくれるのを待つ。
  2. PHP を独自ビルドにして、Apache が参照するモジュールを入れ替える。
  3. WordPress を適当にパッチをあてて動かす。

まず、Appleがなおしてくれるのは内容的に期待できない。脅威度が低かったりマイナーだったりするとセキュリティ上の問題でも延期するし。OSX Server ならばともかくクライアントだしね。

次のPHP独自ビルドは、できれば避けたい選択肢。きちんとmakeするのは正直しんどい。前にやった時は謎のドツボにはまって、画像がアップロードできないなんて状態になっていた。

というわけで、まずはお手軽に、それっぽい関数にパッチをあてて試してみる。案の定 wp-include/functions.php に current_time() なんてものがあったので、試しに改変。

return ( $gmt ) ? ereg_replace('0000', "20" . gmdate('y'), gmdate( 'Y-m-d H:i:s' )) : gmdate( 'Y-m-d H:i:s', ( time() + ( -9 * 3600 ) ) );

うーん、きいていないなあ。調べてみると各所で date(), gmdate() 使いまくりで全然使用されていない。ダメですな。

というわけで、gmdate() を使っている関数を列挙してみると…フムン。ふふ…いいさ…やってやるさorz

  • import/blogger.php
  • import/blogware.php
  • import/rss.php
  • includes/dashboard.php
  • includes/template.php
  • includes/upgrade.php
  • options-general.php
  • wp-admin/admin-ajax.php
  • wp-admin/gears-manifest.php
  • wp-admin/import/blogger.php
  • wp-admin/import/blogware.php
  • wp-admin/import/rss.php
  • wp-admin/includes/dashboard.php
  • wp-admin/includes/template.php
  • wp-admin/includes/upgrade.php
  • wp-admin/load-scripts.php
  • wp-admin/load-styles.php
  • wp-app.php
  • wp-content/plugins/ktai_style/tags.php
  • wp-content/plugins/post-gallery/thirdparty/phpthumb/phpThumb.php
  • wp-content/plugins/post-revisions/post-revisions.php
  • wp-content/plugins/wassup/lib/action.php
  • wp-content/plugins/wassup/lib/main.php
  • wp-content/plugins/wassup/lib/settings.php
  • wp-content/plugins/wassup/wassup.php
  • wp-content/plugins/wp-amazon/wp-amazon-plugin.php
  • wp-content/plugins/wp-cache/wp-cache-phase2.php
  • wp-content/themes/wp.vicuna.ext/functions.php
  • wp-includes/class-simplepie.php
  • wp-includes/classes.php
  • wp-includes/formatting.php
  • wp-includes/functions.php
  • wp-includes/general-template.php
  • wp-includes/js/tinymce/plugins/spellchecker/rpc.php
  • wp-includes/js/tinymce/tiny_mce_config.php
  • wp-includes/js/tinymce/wp-tinymce.php
  • wp-includes/link-template.php
  • wp-includes/post.php
  • wp-includes/registration.php
  • wp-links-opml.php
  • wp-mail.php
  • xmlrpc.php

一応野良ビルドのほうも試してみる。phpinfo() から適当にオプションをひっこぬいて…と。

./configure  '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--with-apxs2=/usr/sbin/apxs' '--with-ldap=/usr' '--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr' '--enable-trans-sid' '--with-libxml' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--enable-mbregex' '--enable-dbx' '--enable-sockets' '--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' '--with-mysql-sock=/tmp/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-mysql=/usr/local/mysql' '--with-openssl' '--with-xmlrpc' '--with-xsl=/usr' '--without-pear'

…面倒。やはり駄目か。

関連記事:

Bookmark this on Delicious

Comments:0

Comment Form
Remember personal info

Home > 記事 > 紀元前のWordPress(2)

Return to page top

1