PHP

Top > PHP

歴史

インストール

  • ダウンロード
[root@localhost ~]# cd /usr/local/setup/archive/
[root@localhost archive]# wget http://jp2.php.net/get/php-5.3.2.tar.gz/from/this/mirror
ダウンロードサイトより:md5: 4480d7c6d6b4a86de7b8ec8f0c2d1871
[root@water0 archive]# md5sum php-5.3.2.tar.gz
4480d7c6d6b4a86de7b8ec8f0c2d1871  php-5.3.2.tar.gz
[root@localhost archive]# cd ../make/
[root@localhost make]# tar zxvf ../archive/php-5.3.2.tar.gz
  • インストール
[root@localhost make]# cd php-5.3.2/
[root@water0 php-5.3.2] #./configure \
--with-config-file-path=/etc \
--prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-pdo-mysql=/usr/local/mysql \
--enable-mbstring \
--enable-mbregex \
--enable-zend-multibyte \
--with-zlib \
--with-bz2 \
--with-gd \
--with-jpeg-dir \
--with-png-dir \
--enable-exif \
--with-iconv \
--enable-bcmath \
--with-gmp \
--enable-sockets \
--enable-ftp \
--with-openssl \
--with-curl \
--enable-bcmath 2>&1 |tee configure_100503.log
オプション 説明
--with-config-file-path php.ini の検索ディレクトリパスを指定。デフォルトは、phpをインストールしたディレクトリのetcディレクトリを検索
  • エラー
configure: error: xml2-config not found. Please check your libxml2 installation.
yum install libxml2-devel -y で解決
configure: error: Please reinstall the BZip2 distribution
yum -y install bzip2-devel -y で解決
configure: error: Please reinstall the libcurl distribution -easy.h should be in <curl-dir>/include/curl/
yum install curl-devel -y で解決
configure: error: libjpeg.(a|so) not found.
yum install libjpeg-devel -y で解決
configure: error: libpng.(a|so) not found.
yum install libpng-develで解決
configure: error: Unable to locate gmp.h
yum install gmp-develで解決
他のconfigureの設定:http://akiba.biz/Linux/php.php
[root@water0 php-5.3.2]# make 2>&1 |tee make_100503.log 
[root@water0 php-5.3.2]# make test
[root@water0 php-5.3.2]# make install 2>&1 |tee make_install_100503.log
  • コマンドにPATHを通す
PATHが通ってないので/etc/profileに追加(次回起動時に読み込む
export PATH=$PATH:/usr/local/mysql/bin  ←  一時的な設定
  • MIMEタイプの追加(AddType)
参考:http://www.adminweb.jp/apache/docroot/index4.html
クライアントからリクエストがあったファイルに対して、WWWサーバはファイルの内容を返すと同時にそのファイルがどのような種類のファイルなのかを合わせてクライアントへ返します。その結果、クライアント側は取得したデータを適切な表示方法で扱うことが出来るようになります。
[root@water0 ~]# vi /usr/local/apache/conf/httpd.conf
<IfModule mime_module>
TypesConfig conf/mime.types

AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType application/x-httpd-php .php              ←追加
AddType application/x-httpd-php-source .phps   ←追加
</IfModule>
  • mime.typesのPATH
[root@water0 ~]# less /usr/local/apache/conf/mime.types
  • RCS
  • httpd再起動
[root@water0 conf]# /etc/init.d/httpd restart
  • 確認
http://192.168.1.104/index.php
最終更新:2010年05月09日 16:07
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。