5月 05
Mac OSX Leopard Serverのセキュリティーアップデートを実行するとまたPHPが置き換えられてしまった。
ので、GD付きで再コンパイル。と、gettextも有効にしたかったのでついでにいっしょにコンパイルします。
基本的に前回の記事にgettextを追加した内容になります。
- libpng 1.4.1
- libjpeg jpeg-8a
- gd 2.0.35
- gettext 0.17
- php 5.2.12
バグの修正については前回の記事と同様に適用します。
$ cd ~/Downloads/src/libpng-1.4.1
$ CFLAGS="-arch x86_64" CCFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure
$ make
$ sudo make install
$ cd ~/Downloads/src/gd-2.0.35
$ CFLAGS="-arch x86_64" ./configure
$ cp libtool ../jpeg-8a/
$ cd ../jpeg-8a/
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --enable-shared
$ make
$ sudo make install
$ cd ~/Downloads/src/gd-2.0.35
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6
$ make
$ sudo make install
$ cd ~/Downloads/src/gettext-0.17
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64" CCFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure --prefix=/usr
$ make
$ sudo make install
$ cd ~/Downloads/src/php-5.2.12
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --prefix=/usr --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-xml --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=/var/mysql --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr --with-openssl --with-xmlrpc --with-xsl=/usr --without-pear --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/X11R6 --with-gd=/usr/local -with-gettext=/usr
$ make
$ make test
$ sudo make install
phpinfoを確認すると無事GDとgettextが有効になっていました。

written by chibiegg
トラックバックURL : http://blog.chibiegg.net/2010/05/05_01_509.htm/trackback
4月 17
Mac OSX Server 10.5.8のアップデートをしたらPHPのバージョンが5.2.12にアップされていて、またGDが入っていなかったので再コンパイル。
GDぐらい一緒にコンパイルしておいて欲しいのですが…今回つかったライブラリのバージョンは以下の通り。
- libpng 1.4.1
- libjpeg jpeg-8a
- gd 2.0.35
- php 5.2.12
今回は前回のMacにおけるiconv関係バグに加え、DNS関係のバグ(Bug #50508)が有り、php-5.2.12/ext/standard/dns.c の58行目からを以下のように修正しました。前回のiconvについての修正も行う必要があります。
#if HAVE_ARPA_NAMESER_COMPAT_H
#include
#endif
を
#if HAVE_ARPA_NAMESER_COMPAT_H
#ifndef HAVE_ARPA_NAMESER_H
#include
#endif
#endif
に変更してから以下のようにコンパイルしました。
$ cd ~/Downloads/src/libpng-1.2.40
$ CFLAGS="-arch x86_64" CCFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure
$ make
$ sudo make install
$ cd ~/Downloads/src/gd-2.0.35
$ CFLAGS="-arch x86_64" ./configure
$ cp libtool ../jpeg-8a/
$ cd ../jpeg-8a/
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --enable-shared
$ make
$ sudo make install
$ cd ~/Downloads/src/gd-2.0.35
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6
$ make
$ sudo make install
$ cd ~/Downloads/src/php-5.2.12
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --prefix=/usr --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-xml --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=/var/mysql --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr --with-openssl --with-xmlrpc --with-xsl=/usr --without-pear --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/X11R6 --with-gd=/usr/local
$ make
$ make test
$ sudo make install
written by chibiegg
トラックバックURL : http://blog.chibiegg.net/2010/04/17_21_499.htm/trackback
1月 11
以前の記事で、WordPressでの自動アップデートを成功させるためには、FTP_BASEやFTP_CONTENT_DIRやFTP_PLUGIN_DIRを定義すればよいと記事に書きました。
が、その記事に書いた通りLinux(Debian)では正しく動作していたのにLeopard Serverにしてからうまく行かなくなっていました。
しかも「ディレクトリが見つかりません」というようなわかりやすいエラーではなく「ファイルをコピーできませんでした」というエラー…
表示されるパスには間違いはないし、パーミッションも777にしてみても(すでになっている)駄目。
ちなみに「ファイルをコピーできませんでした」というエラーはPHPがセーフモードで動いている場合によく出るそうですが、今回はセーフモードで動かしてはいません。
で、諦めていたのですが、いっそのことFTP_BASEやFTP_CONTENT_DIRやFTP_PLUGIN_DIRの定義をコメントアウト(削除)してみるとなんとすんなり成功。
(下部の追記参照)
ということで、セーフモードでもないのに「ファイルをコピーできませんでした」と言われた時は一度FTPのディレクトリ設定を削除してみるのも手かもしれません。
追記
どうやらCodexのFTP_BASE等の説明には「インストールした WordPress のベースフォルダへのフルパス。」と書いてあるので”サーバー内でのフルパス”だと思っていたのですが、少なくともOSXでは”FTPでアクセスした時のパス”が正しいようです。(OSの問題では無いようなな気もしますが)
Codexにも「FTPユーザとしてサーバ上にある各フォルダへのパスが分かっていれば…」とあるので”FTPでアクセスした時のパス”が正しいようです。
つまり「/Users/name/Sites/wp-content/」ではなくFTPから見た時のパスなので「/Sites/wp-content/」とするとFTP_BASE等を定義しても自動アップデートできました。
written by chibiegg
トラックバックURL : http://blog.chibiegg.net/2010/01/11_12_462.htm/trackback
11月 13
アップデートしたときにPHPのバージョンも変更(5.2.10)されていたことに気づかず、GDが入っていないPHPに置き換えられていたので再度PHPをGD付きでコンパイルしたのでメモ。
各ライブラリの今回利用したバージョンは以下の通り。
- libpng 1.2.40
- libjpeg jpeg-7
- gd 2.0.35
- php 5.2.10
PHPをMacでコンパイルするとlibiconv関係でリンク時にエラーが出る問題があるそうなのでext/iconv/iconv.cの196行目あたりを以下のように書き換えてからコンパイルに移ります。(参照:PHP Bugs: #49267: Linking fails for iconv: “Undefined symbols: _libiconv”)
Before
#ifdef HAVE_LIBICONV
#define iconv libiconv
#endif
After
#ifdef HAVE_LIBICONV
#define iconv iconv
#endif
実行した手順だけを載せます。
$ cd ~/Downloads/src/libpng-1.2.40
$ CFLAGS="-arch x86_64" CCFLAGS="-arch x86_64" CXXFLAGS="-arch x86_64" LDFLAGS="-arch x86_64" ./configure
$ make
$ sudo make install
$ cd ~/Downloads/src/gd-2.0.35
$ CFLAGS="-arch x86_64" ./configure
$ cp libtool ../jpeg-7/
$ cd ../jpeg-7/
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --enable-shared
$ make
$ sudo make install
$ cd ~/Downloads/src/gd-2.0.35
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --with-zlib-dir=/usr --with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/X11R6 --with-freetype-dir=/usr/X11R6 --with-xpm-dir=/usr/X11R6
$ make
$ sudo make install
$ cd ~/Downloads/src/php-5.2.10
$ MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure --prefix=/usr --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-xml --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=/var/mysql --with-mysqli=/usr/bin/mysql_config --with-mysql=/usr --with-openssl --with-xmlrpc --with-xsl=/usr --without-pear --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-freetype-dir=/usr/X11R6 --with-gd=/usr/local
$ make
$ make test
$ sudo make install
written by chibiegg
トラックバックURL : http://blog.chibiegg.net/2009/11/13_22_432.htm/trackback
7月 06
先日Mac OSX Server Leopard を更新してからWordPressでサムネイルが作成されなくなったなぁと思っていたのですが、アップデートの際に以前GDをServerにインストールしたときからPHPのバージョンが5.2.8に変更されていたのでまたGDのついていないPHPのバイナリに交換されてしまったようです。ということで、以前と同様にGDをインストールしました。方法は以前の「OSX Server 10.5 (64bit)でPHP+GD」を参照していただくとして、今回利用した各ライブラリのバージョンは以下の通りです。それをメモするだけなので日記ということで、適当な更新です。
- PHP 5.2.8
- libgd 2.0.35
- libpng 1.2.37
- libjpeg(jpeg v7)
コンパイル時にはいくつか注意点が…
続きを読む »
written by chibiegg
トラックバックURL : http://blog.chibiegg.net/2009/07/06_21_372.htm/trackback
最近のコメント