• Xcode tools
  • グーグル先生:http://www.google.co.jp/
  • ほんのちょっとのターミナルの知識
  • 転んでも泣かない勇気
  • ソースコードを入手する。tar.gz圧縮のものを選ぶ事。
  • ダウソしたtar.gzをホームフォルダに置く。
  • ターミナルを起動
  • tar.gzを「tar xvfz ファイル.tar.gz」で解凍。
  • 解凍して出来たフォルダに「cd ファイル」で移動。
  • 「./configure」する。色々ごちゃごちゃ動くので暫く放置。
  • 「make」する。色々ごちゃごちゃ動くので(ry
  • 「make install」する。色(ry
httpd -v
  • 標準のApacheを「sudo apachectl stop」で停止する。
  • 下記のコマンドを順番に入力(10.5でApache2.2.15をインストールする場合)
    $ tar xvfz httpd-2.2.15.tar.gz
    $ cd httpd-2.2.15
    $ ./configure --enable-modules="so ssl dav" --enable-modules=rewrite --enable-suexec --enable-dav
    $ make
    $ make install
  • とりあえず下記の内容を記入。
    LoadModule php5_module libexec/httpd/libphp5.so
    AddModule mod_php5.c
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
  • 必要に応じて「DocumentRoot?」セクションでhtdocsのディレクトリを変更する。10.5の場合、元のApacheの標準DocumentRoot?は「/Library/WebServer/Documents/」なので、新規にApache2を入れた場合も元の標準DocumentRoot?に合わせておくのが無難。
<?php phpinfo(); ?>
  • 元のPHPの上書きは余りお勧めしません。Apple純正のセキュリティアップデートを掛けた際に、PHPがセキュリティアップデート同梱の古いVerで上書きされてしまう場合があります。。。
  • 下記のコマンドを順番に入力(10.5でPHP5.3.2をインストールする場合)
    $ tar xvfz php-5.3.2.tar.gz 
    $ cd php-5.3.2
    $ sudo ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-ldap=/usr
    --with-kerberos=/usr --enable-cli --with-zlib-dir=/usr --enable-exif --enable-ftp
    --enable-mbstring --enable-mbregex --enable-sockets
    $ make
    $ make install
## 最適な./configureの設定がなかなか見つからないので、お勧めのものがあれば記入お願いします。
  • Apache2を別途インストールした場合には --with-apxs2=/usr/local/apache2/bin/apxs 等、Apache2のインストールパスの指定に注意。
  • ./configureオプションは./configure --helpを参考にお好みで適宜変更しましょう。特に10.4以前の系統でApache2を新規導入して標準のApache1.xをやめた場合には、参考URLの/configureオプションに書かれている「--with-apxs」を「--with-apxs2」に変更する事を忘れずに。
  • Entropy PHPの最新版バイナリは5.3.0。このPHP環境を入れた状態でphpinfoを覗くと、下記の様な./configureでビルドされている事が分かります。
$ ./configure --disable-dependency-tracking --prefix=/usr/local/php5 --with-apxs2=/usr/sbin/apxs
--with-config-file-scan-dir=/usr/local/php5/php.d --with-openssl=/usr --with-zlib=/usr --with-zlib-dir=/usr
--with-gd --with-ldap --with-xmlrpc --enable-exif --enable-soap --enable-sqlite-utf8 --enable-wddx
--enable-ftp --enable-sockets --with-bz2=/usr --enable-zip --enable-pcntl --enable-shmop --enable-sysvsem
--enable-sysvshm --enable-sysvmsg --enable-memory-limit --enable-mbstring --enable-bcmath --enable-calendar
--with-iodbc --with-mhash --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
--with-iconv=/usr/local/php5 --with-mssql=shared,/usr/local/php5 --enable-memcache
--with-imap=../imap-2007e --with-kerberos=/usr --with-imap-ssl=/usr --with-libxml-dir=shared,/usr/local/php5
--with-xsl=shared,/usr/local/php5 --with-gettext=/usr/local/php5 --with-curl=shared,/usr/local/php5
--with-png-dir=/usr/local/php5 --with-jpeg-dir=/usr/local/php5 --enable-gd-native-ttf
--with-freetype-dir=/usr/local/php5 --with-pgsql=shared,/usr/local/php5
--with-pdo-pgsql=shared,/usr/local/php5 --with-mcrypt=shared,/usr/local/php5
  • Entropy PHPはインストールするだけで最新版のP2がとりあえず動作します。P2の動作に必要ない項目もかなりありますが、この./configureを参考にソースのビルドをすれば、ひとまずは最新版PHPを追いかける事が出来ます。
  • 但し、デフォルトの環境だと基本的に./configureやmakeでエラーが出まくると思います。
  • 一番多いのがgettextのエラーかと思います。
    $ Undefined symbols:
    $  "_zif_setlocale", referenced from:
    $     _basic_functions in basic_functions.o
  • 次にエラーが出やすいのはimap。
  • mcryptのビルドも忘れずに。
  • sql関係、特にmssqlやpgsqlもエラーが出やすいですが、ぶっちゃけsqliteだけあればいいので、両方とも./configureから外します。mssqlは「--with-mssql=shared,/usr/local/php5」、pgsqlは「--with-pgsql=shared,/usr/local/php5 --with-pdo-pgsql=shared,/usr/local/php5」を削除。
  • この位までビルドや修正を行えばmake installまで無事に済むと思います。先に「/usr/local/php5」フォルダにインストールしてあるentropyPHPの上書きを防ぐ為に、フォルダ名を「/usr/local/php53」に変更しています。
    $ ./configure --disable-dependency-tracking --prefix=/usr/local/php53 --with-apxs2=/usr/sbin/apxs
    --with-config-file-scan-dir=/usr/local/php53/php.d --with-openssl=/usr --with-zlib=/usr--with-zlib-dir=/usr
    --with-gd --with-ldap --with-xmlrpc --enable-exif --enable-soap --enable-sqlite-utf8 --enable-wddx
    --enable-ftp --enable-sockets --with-bz2=/usr --enable-zip --enable-pcntl --enable-shmop --enable-sysvsem
    --enable-sysvshm --enable-sysvmsg --enable-memory-limit --enable-mbstring --enable-bcmath --enable-calendar
    --with-iodbc --with-mhash --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
    --with-iconv=/usr/local/php53 --enable-memcache  --with-kerberos=/usr
    --with-libxml-dir=shared,/usr/local/php53 --with-xsl=shared,/usr/local/php53 --with-gettext=/usr/local
    --with-curl=shared,/usr/local/php53 --with-png-dir=/usr/local/php53 --with-jpeg-dir=/usr/local/php53
    --enable-gd-native-ttf --with-freetype-dir=/usr/local/php53 --with-mcrypt=shared,/usr/local
  • 外部HDD等のパス
  • htdocsのエイリアス設定
Alias /Volumes/xxx/rep2/DATA/cache "/Volumes/xxx/rep2/DATA/cache"
   <Directory "/Volumes/xxx/rep2/DATA/cache">
       Allow from all
   </Directory>

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2011-02-04 (金) 19:54:44 (4831d)