libphp5.so: mach-o, but wrong architecture

で、

Mar 11 14:38:32 macminikume org.apache.httpd[77745]: httpd: Syntax error on line 160 of /private/etc/apache2/httpd.conf: Cannot load /opt/local/apache2/modules/libphp5.so into server: dlopen(/opt/local/apache2/modules/libphp5.so, 10): no suitable image found.  Did find:\n\t/opt/local/apache2/modules/libphp5.so: mach-o, but wrong architecture

だ。
アーキテクチャーが、違う、のね。はいはい。
ググってみると...キーワードはどーする?
エラーメッセージの一部の文字列をそのままキーワードにする...らんぼー


うへー、2年前かよ。
まぁ、いくつかコマンドを実行してみるか。
まず、すんなり稼働した PPC マシン Leopard ... G4。

file /opt/local/bin/php
/opt/local/bin/php: Mach-O executable ppc

lipo -info /opt/local/bin/php
Non-fat file: /opt/local/bin/php is architecture: ppc7400

file /usr/sbin/httpd 
/usr/sbin/httpd: Mach-O fat file with 4 architectures

lipo -info /usr/sbin/httpd
Architectures in the fat file: /usr/sbin/httpd are: ppc7400 ppc64 i386 x86_64


そして、ダメダメだった Intel Leopard マシン。

file /opt/local/bin/php
/opt/local/bin/php: Mach-O executable i386

lipo -info /opt/local/bin/php
Non-fat file: /opt/local/bin/php is architecture: i386

file /usr/sbin/httpd
/usr/sbin/httpd: Mach-O fat file with 4 architectures

lipo -info /usr/sbin/httpd
Architectures in the fat file: /usr/sbin/httpd are: ppc7400 ppc64 i386 x86_64


そんで、Intel Snow Leopard なら...

file /opt/local/bin/php
/opt/local/bin/php: Mach-O 64-bit executable

lipo -info /opt/local/bin/php
Non-fat file: /opt/local/bin/php is architecture: x86_64

file /usr/sbin/httpd
/usr/sbin/httpd: Mach-O fat file with 3 architectures

lipo -info /usr/sbin/httpd
Architectures in the fat file: /usr/sbin/httpd are: x86_64 i386 ppc7400


Apple が導入した apache2 は、ふぁっとばいなり〜
導入された PHP が ppc ならば、PPC マシン...ppc7400...たぶんG4...であれば、問題なく動いた訳だな。
でもって、導入された PHP が x86_64 ならば、Intel マシン Snow Leopard で、問題なく動いた訳だな。
ふむ。
要するに、PHP と httpd がどのアーキテクチャーで稼働するようになっているのか、食い違ってはダメって事だ。

後は、ふぁっとばいなり〜をダイエットさせちまえっ...らんぼー

cd /usr/sbin/
cp -p httpd httpd_fat_file_with_4_architectures
lipo /usr/sbin/httpd -thin i386 -output /usr/sbin/httpd
or
lipo /usr/sbin/httpd -thin ppc7400 -output /usr/sbin/httpd

ふぅ

これで、動くようになりましたぜ。
phpMyAdmin を使っても、
mcrypt 拡張をロードできません。PHP の設定を確認してください
とは、表示されなくなった。


ちなみに、MacPortsで導入した apache2 の元では、PHP は問題なく動いていた。
後付けで、Intel マシン Leopard の場合だけど、

lipo -info /opt/local/apache2/bin/httpd 
Non-fat file: /opt/local/apache2/bin/httpd is architecture: i386

ということだった。i386 で共通だ。

トラックバック(0)

このブログ記事を参照しているブログ一覧: libphp5.so: mach-o, but wrong architecture

このブログ記事に対するトラックバックURL: http://www.kumecchi.net/mt/mt-tb.cgi/1042

コメントする

QRコード

QRコード対応携帯からアクセスできます
QRコード対応携帯からアクセスできます  
Creative Commons License
このブログのライセンスは クリエイティブ・コモンズライセンス.
Powered by Movable Type 5.12

Yahoo!ブログの記事

飼い主になっていただきます : 2012年01月14日

病院の玄関のフラワーポッド : 2012年01月10日

病院の水槽の生き物 : 2012年01月09日

2円の買い物 : 2012年01月07日

新年のご挨拶 : 2012年01月03日

阿蘇にて、2011/12/17-18 : 2011年12月20日

時速1000Km/hじゃ、の、別バージョン : 2011年12月19日

時速1000Km/hじゃ : 2011年12月18日

ぶどう、では、ない : 2011年12月15日

怖い顔 : 2011年12月13日

月別 アーカイブ

2011

  3 2 1

2010

  12 11 10 9 8 7 6 5 4 3 2

2009

  11 10 6 5 4 3 2 1

2008

  11 9 8 7 6 5 4 3 2

2007

  12 11 8 7 6 5 4 3 2 1

2006

  12 11 10 9 8 7 6 5 4 3 2 1

2005

  12 11 10 9 8 7 6 4 3 1

2004

  12 11 10 9 8 7 6 5 4

2003

  12 7 6 5 4 3 1

2002

  12 11 9 8 7 6 5 4 3 2 1

2001

  12 11 10 9 8 7 6 5 4 3 2 1

2000

  12 11 10 9 8