やばい、眠れん。
このブログサーバー、MacPorts のアップデートを cron で実行している。
00 12 * * 0 /private/var/root/bin/portupdate_cron
で、portupdate_cron の中身は、いたって簡単。
#!/bin/csh -f
#
/opt/local/bin/port selfupdate
/opt/local/bin/port sync
/opt/local/bin/port -u upgrade installed
こんな感じ。
で、だ。
誰が命令したんだっApple の Software Update でも、PHP のバージョンが上がって、
PHP 5.2.11 (cli) (built: Dec 14 2009 19:23:40)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
なんだな。
ならばっ、この際だから、PHP 5.3.2 の恩恵にあずかろう!、おーっ
何しろ、MacPorts を介せば、php5-mcrypt @5.3.2_0
も導入できるのだ、必ずや、あんなメッセージは出なくなるはず。
port install apache2
これは無事に終了。次が、
port install php5 +apache2 +fastcgi +pear
これも、無事に終了。
いいね。
後は、
port search php | grep “@5.3.2”
で表示されたモジュールを、ぜぇーんぶ、入れることにした。
port search php | grep “@5.3.2” | awk ‘{print “port install “$1}’ > /tmp/dd
sh /tmp/dd
実際には、次のモノドモ。
port install php5-calendar
port install php5-curl
port install php5-dba
port install php5-exif
port install php5-ftp
port install php5-gd
port install php5-gettext
port install php5-gmp
port install php5-iconv
port install php5-imap
port install php5-intl
port install php5-mbstring
port install php5-mcrypt
port install php5-mysql
port install php5-odbc
port install php5-openssl
port install php5-posix
port install php5-snmp
port install php5-soap
port install php5-sockets
port install php5-sqlite
port install php5-tidy
port install php5-wddx
port install php5-xmlrpc
port install php5-xsl
port install php5-zip
つつがなく終了。
後は、php.ini の設定をちょこっと。
こんなのを加えてみた。
error_reporting = E_ALL & ~E_DEPRECATED& ~E_NOTICE
pdo_mysql.default_socket = /var/mysql/mysql.sock
mysql.default_socket = /var/mysql/mysql.sock
mysqli.default_socket = /var/mysql/mysql.sock
mbstring.language = Japanese
default_charset = “UTF-8”
date.timezone = “Asia/Tokyo”
mbstring.internal_encoding = UTF-8
mbstring.http_input = auto
mbstring.http_output = UTF-8
mbstring.encoding_translation = On
mbstring.substitute_character = none;
そして、apache2 の設定をちょこっと。
cd /etc/apache2/
vi httpd.conf
以下の行を追加する、あるいは、既存の行と置き換える。
LoadModule php5_module /opt/local/apache2/modules/libphp5.so
いよいよ、apache2 の再起動、
apachectl restart
しかぁーし、Webサービスが停止しちまったぜ。
system.log に、怪しい記述が…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
しらねーよー、あたしが作ったモジュールじゃねぇし、アーキテクチャーが違う、って言われてもなー
続く…