Snow LeopardにMac PortsでApache2+PHP5+MySQL5をインストールしたメモ
MBPをSnow Leopardにやっとアップデートしたので、その際のメモ。
まずはSnow Leopard用のMac portsをサイトからダウンロードして、インストール。その後、port自身のupdateを行います。
sudo port selfupdate
はい、準備ここまで。僕の場合、過去の資産はほぼ全てSVNに突っ込んでいるため、/optを惜しみなく削除をしたのちに、portのインストールを行いました。
次はMySQL5のインストールと、起動設定、初期設定。
sudo port install mysql5-server
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo -u _mysql mysql_install_db5
sudo ln /opt/local/bin/mysql5 /opt/local/bin/mysql
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
sudo -u _mysql mysql_install_db5
sudo ln /opt/local/bin/mysql5 /opt/local/bin/mysql
ああ、簡単。次はApache2へ
sudo port install apache2
が、エラーが出た。
Error: Checksum (md5) mismatch for httpd-2.2.14.tar.bz2
Error: Checksum (sha1) mismatch for httpd-2.2.14.tar.bz2
Error: Checksum (rmd160) mismatch for httpd-2.2.14.tar.bz2
Error: Target org.macports.checksum returned: Unable to verify file checksums
Error: Status 1 encountered during processing.
Before reporting a bug, first run the command again with the -d flag to get complete output.
Error: Checksum (sha1) mismatch for httpd-2.2.14.tar.bz2
Error: Checksum (rmd160) mismatch for httpd-2.2.14.tar.bz2
Error: Target org.macports.checksum returned: Unable to verify file checksums
Error: Status 1 encountered during processing.
Before reporting a bug, first run the command again with the -d flag to get complete output.
うーむ、なぜ?と思いながら、一旦、cleanしてみてやり直して見ることに。
sudo port clean --all apache2
sudo port install apache2
sudo port install apache2
お、出来ました。すかさず、Apache2の起動設定を行います。
sudo launchctl load -w /Library/LaunchDaemons/org.macports.apache2.plist
最後は、PHP5をインストール。
sudo port install php5 +apache2 +mysql5 +sqlite +pear
sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.ini
sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so
sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.ini
ApacheにPHPの設定を施す。
sudo vi /opt/local/apache2/conf/httpd.conf
AddType application/x-httpd-php .php # この行をhttpd.confに追加
sudo /opt/local/apache2/bin/apachectl restart
AddType application/x-httpd-php .php # この行をhttpd.confに追加
sudo /opt/local/apache2/bin/apachectl restart
念の為、info.phpを作成して閲覧してみると、こんな感じに起動します。

他に必要なものは順次インストールするとして、とりあえずのベースは出来ました。めでたしめでたし。
Posted in: 技術の話
2件のコメント
Comments RSS
TrackBack Identifier URI
ピンバック by Tweets that mention Straighten » Snow LeopardにMac PortsでApache2+PHP5+MySQL5をインストールしたメモ -- Topsy.com on 2010年4月15日 9:43 PM
コメント by Joshua Morris on 2010年4月23日 5:53 AM
コメントする

