PHPインストール †(1)インストール前準備 (1) インストール前準備 - PHPをインストールする前に入れておくと都合がよいものを先にインストール ・rootになる su ・jpeg(/usr/local/lib) tar xvzf jpegsrc.v6b.tar.gz cd jpeg-6b ./configure --enable-shared make make install # /usr/local/man/man1というディレクトリがない” と怒られたので作ってから再度実行した ・zlib(/usr/local/lib) tar xvzf zlib-1.2.1.tar.gz cd zlib-1.2.1 ./configure --shared make make install ・png(/usr/local/lib) (zlibが必要) tar xvzf libpng-1.2.5.tar.gz cd libpng-1.2.5 cp scripts/makefile.std ./makefile vi ./makefile # makefileを書換え -- ここから -- ZLIBLIB=/usr/local/lib ZLIBINC=/usr/local/include -- ここまで -- make make install ・GD(/usr/local) ※PHP等から画像を動的に生成する場合は必須(pngが必要) tar xvzf gd-2.0.12.tar.gz cd gd-2.0.12 ./configure --with-jpeg=/usr/local --with-png=/usr/local make make install ・libxml2(/usr/local/lib) ※PHP5を入れるときは必須(libxml2-2.5.10以上) tar zxfv libxml2-2.6.0.tar.gz cd libxml2-2.6.0 ./configure make make install ・rootになる su ・インストール cd /usr/local/src tar zxfv php-5.0.2.tar.gz cd /usr/local/src/php-5.0.2 ./configure --with-pgsql --with-apxs2=/usr/local/apache2/bin/apxs --enable-mbstring --enable-mbregex --without-mysql \ --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-zlib-dir=/usr/local --with-libxml-dir=/usr/local \ --with-oracle=/opt/app/oracle/product/10.1.0/client_1 --with-oci8=/opt/app/oracle/product/10.1.0/client_1 make make install
vi /usr/local/lib/php.ini -- ここから -- ・ ・ 中略 ・ ・ register_globals = Off mbstring.language = Japanese mbstring.internal_encoding = SJIS mbstring.http_input = auto mbstring.http_output = SJIS mbstring.encoding_translation = On mbstring.detect_order = auto ・ ・ 中略 ・ ・ -- ここまで -- PHPをCGIとして動かすには、 普通は #!/usr/bin/php などをファイルの頭に追加して・・・等をしなくちゃいけないが、 1. Apacheの設定ファイル(httpd.conf)に以下を追加する。 ScriptAlias /php/ "/usr/bin/" Action application/x-httpd-phpcgi "/php/php" ※ /usr/bin/ は phpがインストールされているディレクトリ(Windowsの場合は、c:/php/ など) 2. Apacheの設定ファイル(httpd.conf) または .hraccess に以下を追加する。 AddHandler application/x-httpd-phpcgi .php 3. php.ini の設定を変更する cgi.force_redirect = 0 ※ホントに要るのかは良くわからん。 |