ツムラ_メモ

大失敗を繰り返す。

WordPressへのインストールに失敗していた原因いろいろ。

Wordpressのインストールに失敗する原因がわからずにPHPをインストールしたりと色々と瞑想していたころの記録。
正しいインストール方法は昨日の日記を参考に。


PHP5をMacPortsでインストール

sh-3.2# port install php5

      • > Computing dependencies for autoconf
      • > Fetching autoconf
      • > Attempting to fetch autoconf-2.64.tar.bz2 from ftp://ftp.dti.ad.jp/pub/GNU/autoconf
      • > Verifying checksum(s) for autoconf
      • > Extracting autoconf
      • > Configuring autoconf
      • > Building autoconf
      • > Staging autoconf into destroot
      • > Deactivating autoconf @2.63_0
      • > Computing dependencies for autoconf
      • > Installing autoconf @2.64_2
      • > Activating autoconf @2.64_2
      • > Cleaning autoconf
      • > Computing dependencies for zlib
      • > Fetching zlib
      • > Verifying checksum(s) for zlib
      • > Extracting zlib
      • > Applying patches to zlib
      • > Configuring zlib
      • > Building zlib
      • > Staging zlib into destroot
      • > Deactivating zlib @1.2.3_2
      • > Computing dependencies for zlib
      • > Installing zlib @1.2.3_3
      • > Activating zlib @1.2.3_3
      • > Cleaning zlib
      • > Computing dependencies for libxml2
      • > Fetching libxml2
      • > Attempting to fetch libxml2-2.7.6.tar.gz from http://distfiles.macports.org/libxml2
      • > Verifying checksum(s) for libxml2
      • > Extracting libxml2
      • > Configuring libxml2
      • > Building libxml2
      • > Staging libxml2 into destroot
      • > Deactivating libxml2 @2.7.3_0
      • > Computing dependencies for libxml2
      • > Installing libxml2 @2.7.6_0
      • > Activating libxml2 @2.7.6_0
      • > Cleaning libxml2
      • > Computing dependencies for bzip2
      • > Fetching bzip2
      • > Verifying checksum(s) for bzip2
      • > Extracting bzip2
      • > Applying patches to bzip2
      • > Configuring bzip2
      • > Building bzip2
      • > Staging bzip2 into destroot
      • > Deactivating bzip2 @1.0.5_2
      • > Computing dependencies for bzip2
      • > Installing bzip2 @1.0.5_3+darwin
      • > Activating bzip2 @1.0.5_3+darwin
      • > Cleaning bzip2
      • > Computing dependencies for readline
      • > Fetching readline
      • > Verifying checksum(s) for readline
      • > Extracting readline
      • > Applying patches to readline
      • > Configuring readline
      • > Building readline
      • > Staging readline into destroot
      • > Deactivating readline @6.0.000_1
      • > Computing dependencies for readline
      • > Installing readline @6.0.000_2+darwin
      • > Activating readline @6.0.000_2+darwin
      • > Cleaning readline
      • > Computing dependencies for apr
      • > Fetching apr
      • > Attempting to fetch apr-1.3.9.tar.bz2 from http://distfiles.macports.org/apr
      • > Verifying checksum(s) for apr
      • > Extracting apr
      • > Configuring apr
      • > Building apr
      • > Staging apr into destroot
      • > Deactivating apr @1.3.5_0
      • > Computing dependencies for apr
      • > Installing apr @1.3.9_0
      • > Activating apr @1.3.9_0
      • > Cleaning apr
      • > Computing dependencies for db46
      • > Fetching db46
      • > Attempting to fetch patch.4.6.21.1 from http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/
      • > Attempting to fetch patch.4.6.21.2 from http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/
      • > Attempting to fetch patch.4.6.21.3 from http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/
      • > Attempting to fetch patch.4.6.21.4 from http://www.oracle.com/technology/products/berkeley-db/db/update/4.6.21/
      • > Attempting to fetch db-4.6.21.tar.gz from http://distfiles.macports.org/db4/4.6.21_6
      • > Verifying checksum(s) for db46
      • > Extracting db46
      • > Applying patches to db46
      • > Configuring db46
      • > Building db46
      • > Staging db46 into destroot
      • > Deactivating db46 @4.6.21_5
      • > Computing dependencies for db46
      • > Installing db46 @4.6.21_6
      • > Activating db46 @4.6.21_6
      • > Cleaning db46
      • > Computing dependencies for sqlite3
      • > Fetching sqlite3
      • > Attempting to fetch sqlite-3.6.19.tar.gz from http://distfiles.macports.org/sqlite3/3.6.19
      • > Verifying checksum(s) for sqlite3
      • > Extracting sqlite3
      • > Configuring sqlite3
      • > Building sqlite3
      • > Staging sqlite3 into destroot
      • > Deactivating sqlite3 @3.6.16_0
      • > Computing dependencies for sqlite3
      • > Installing sqlite3 @3.6.19_0
      • > Activating sqlite3 @3.6.19_0
      • > Cleaning sqlite3
      • > Computing dependencies for apr-util
      • > Fetching apr-util
      • > Attempting to fetch apr-util-1.3.9.tar.bz2 from ftp://ftp.infoscience.co.jp/pub/net/apache/dist/apr
      • > Attempting to fetch apr-util-1.3.9.tar.bz2 from http://distfiles.macports.org/apr-util
      • > Verifying checksum(s) for apr-util
      • > Extracting apr-util
      • > Configuring apr-util
      • > Building apr-util
      • > Staging apr-util into destroot
      • > Deactivating apr-util @1.3.7_0
      • > Computing dependencies for apr-util
      • > Installing apr-util @1.3.9_0
      • > Activating apr-util @1.3.9_0
      • > Cleaning apr-util

Warning: Skipping upgrade since openssl 0.9.8k_0 >= openssl 0.9.8k_0, even though installed variants "" do not match "+darwin". Use 'upgrade --enforce-variants' to switch to the requested variants.

###########################################################
# A startup item has been generated that will aid in
# starting apache2 with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
###########################################################
Note: apache2 installs files outside the common directory structure.

      • > Deactivating apache2 @2.2.11_0+darwin_9
      • > Computing dependencies for apache2
      • > Installing apache2 @2.2.14_0+darwin+darwin_9+preforkmpm
      • > Activating apache2 @2.2.14_0+darwin+darwin_9+preforkmpm
      • > Cleaning apache2
      • > Computing dependencies for php5
      • > Fetching autoconf213
      • > Attempting to fetch autoconf-2.13.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/autoconf
      • > Verifying checksum(s) for autoconf213
      • > Extracting autoconf213
      • > Configuring autoconf213
      • > Building autoconf213
      • > Staging autoconf213 into destroot
      • > Installing autoconf213 @2.13_1
      • > Activating autoconf213 @2.13_1
      • > Cleaning autoconf213
      • > Fetching gsed
      • > Attempting to fetch sed-4.2.1.tar.gz from ftp://ftp.dti.ad.jp/pub/GNU/sed
      • > Verifying checksum(s) for gsed
      • > Extracting gsed
      • > Configuring gsed
      • > Building gsed
      • > Staging gsed into destroot
      • > Installing gsed @4.2.1_0
      • > Activating gsed @4.2.1_0
      • > Cleaning gsed
      • > Fetching mhash
      • > Attempting to fetch mhash-0.9.9.9.tar.bz2 from http://voxel.dl.sourceforge.net/mhash
      • > Verifying checksum(s) for mhash
      • > Extracting mhash
      • > Configuring mhash
      • > Building mhash
      • > Staging mhash into destroot
      • > Installing mhash @0.9.9.9_0
      • > Activating mhash @0.9.9.9_0
      • > Cleaning mhash
      • > Fetching php5
      • > Attempting to fetch php-5.3.0.tar.bz2 from http://www.php.net/distributions/
      • > Verifying checksum(s) for php5
      • > Extracting php5
      • > Applying patches to php5
      • > Configuring php5
      • > Building php5
      • > Staging php5 into destroot

Note: php5 installs files outside the common directory structure.

      • > Installing php5 @5.3.0_3+apache2+macosx
      • > Activating php5 @5.3.0_3+apache2+macosx

To customize php, copy
/opt/local/etc/php5/php.ini-development (if this is a development server) or
/opt/local/etc/php5/php.ini-production (if this is a production server) to
/opt/local/etc/php5/php.ini and then make changes.

If this is your first install, you need to activate PHP in your web server.

To enable PHP in Apache, run
cd /opt/local/apache2/modules
/opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so

      • > Cleaning php5

PHPのモジュールをデフォルトのPHPと入れ替える

以下のコマンドで設定ファイルをコピー
cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.ini
MySQLのソケットの場所に合わせて設定を変更

今度はApacheの動作がおかしくなってしまった

Syntaxエラーで終了と再起動を繰り返してしまっているようで。

httpd: Syntax error on line 118 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
com.apple.launchd[1] (org.apache.httpd[75044]) : Exited with exit code: 1
com.apple.launchd[1] (org.apache.httpd) : Throttling respawn: Will start in 10 seconds


検索してみると以下のサイトがHitした!
http://archive.netbsd.se/?ml=macports-dev&a=2007-10&t=5547524

何かいろいろと問題がありそうだ。
正しいインストール方法は昨日の日記を。