差分
このページの2つのバージョン間の差分を表示します。
| 両方とも前のリビジョン 前のリビジョン | |||
| linux:centos:centos6_php516_install [2024/02/04 13:41] – 削除 - 外部編集 (Unknown date) 非ログインユーザー | linux:centos:centos6_php516_install [2024/02/04 13:41] (現在) – ↷ linux:centos6_php516_install から linux:centos:centos6_php516_install へページを移動しました。 ともやん | ||
|---|---|---|---|
| 行 1: | 行 1: | ||
| + | ====== CentOS6 に PHP 5.1.6 をインストールする ====== | ||
| + | 以下の内容は、CentOS 6.3 に PHP 5.3.18 (Remiリポジトリ) と MySQL 5.5.28 (Remiリポジトリ) がインストールされた環境に、PHP 5.1.6 を混在させる方法です。\\ | ||
| + | \\ | ||
| + | |||
| + | ===== PHP の古いバージョンを探す ===== | ||
| + | 古いバージョンは[[http:// | ||
| + | |||
| + | ===== 少し古い OpenSSL をソースからインストール ===== | ||
| + | CentOS 6.3 の OpenSSL が 1.0.0 なので、[[https:// | ||
| + | < | ||
| + | $ rpm -qa | grep openssl | ||
| + | openssl-1.0.0-25.el6_3.1.x86_64 | ||
| + | openssl-devel-1.0.0-25.el6_3.1.x86_64 | ||
| + | </ | ||
| + | バグを回避する為に、少し古い OpenSSL をソースからインストールする。\\ | ||
| + | - OpenSSL 0.9.8 のソースをダウンロードする。< | ||
| + | $ cd ~/work | ||
| + | $ curl -O http:// | ||
| + | </ | ||
| + | - ダウンロードした圧縮ファイルを解凍する。< | ||
| + | $ tar zxvf openssl-0.9.8x.tar.gz | ||
| + | </ | ||
| + | - configure する。(openssl は ./ | ||
| + | $ cd openssl-0.9.8x | ||
| + | $ ./config --prefix=/ | ||
| + | </ | ||
| + | - ビルドしてインストールする。< | ||
| + | $ make | ||
| + | $ sudo make install LIBDIR=lib64 | ||
| + | </ | ||
| + | ===== PHP をソースからインストール ===== | ||
| + | - ソースをダウンロードする。< | ||
| + | $ cd work | ||
| + | $ curl -O http:// | ||
| + | </ | ||
| + | - ダウンロードした圧縮ファイルを解凍する。< | ||
| + | $ tar jxvf php-5.1.6.tar.bz2 | ||
| + | </ | ||
| + | - ビルドに必要なパッケージをインストールする。< | ||
| + | $ sudo yum install zlib-devel openssl-devel db4-devel pcre-devel | ||
| + | $ sudo yum install libicu libicu-devel gettext-devel gd-devel | ||
| + | $ sudo yum install readline-devel libxml2-devel libxslt-devel | ||
| + | $ sudo yum install libcurl-devel | ||
| + | $ sudo yum install mysql-devel postgresql-devel --enablerepo=remi | ||
| + | </ | ||
| + | - configure する。< | ||
| + | $ cd php-5.1.6 | ||
| + | $ ./configure \ | ||
| + | --prefix=/ | ||
| + | --with-config-file-path=/ | ||
| + | --enable-cli \ | ||
| + | --with-libdir=lib64 \ | ||
| + | --enable-mbstring=shared \ | ||
| + | --enable-intl=shared \ | ||
| + | --with-icu-dir=shared \ | ||
| + | --with-gettext=shared \ | ||
| + | --with-pcre-regex=shared \ | ||
| + | --with-pcre-dir=shared \ | ||
| + | --with-readline=shared \ | ||
| + | --with-libxml-dir=/ | ||
| + | --enable-soap \ | ||
| + | --enable-wddx \ | ||
| + | --with-xmlrpc \ | ||
| + | --with-xsl=shared \ | ||
| + | --enable-force-cgi-redirect \ | ||
| + | --enable-mbstr-enc-trans \ | ||
| + | --enable-track-vars \ | ||
| + | --enable-mbregex \ | ||
| + | --with-gd=shared \ | ||
| + | --with-jpeg-dir=/ | ||
| + | --with-png-dir=/ | ||
| + | --enable-gd-native-ttf \ | ||
| + | --with-openssl=/ | ||
| + | --with-zlib=shared \ | ||
| + | --with-curl=shared \ | ||
| + | --enable-ftp=shared \ | ||
| + | --with-mysql=shared \ | ||
| + | --with-mysqli=shared \ | ||
| + | --with-pdo-mysql=shared \ | ||
| + | --with-pdo-sqlite=shared \ | ||
| + | --with-pgsql=shared \ | ||
| + | --enable-sqlite-utf8 \ | ||
| + | --enable-zend-multibyte \ | ||
| + | --program-suffix=51 \ | ||
| + | 2>&1 | tee configure_log.txt | ||
| + | </ | ||
| + | - curl の interface.c がエラーになるので修正する。\\ 以下の2つの行をコメントアウトする。\\ REGISTER_CURL_CONSTANT(CURLOPT_FTPASCII); | ||
| + | $ cp ext/ | ||
| + | $ vi ext/ | ||
| + | $ diff ext/ | ||
| + | 274c274 | ||
| + | < // | ||
| + | --- | ||
| + | > | ||
| + | 314c314 | ||
| + | < // | ||
| + | --- | ||
| + | > | ||
| + | </ | ||
| + | - mysqli の mysqli.c がエラーになるので、mysql.h を修正する。< | ||
| + | enum mysql_protocol_type | ||
| + | { | ||
| + | MYSQL_PROTOCOL_DEFAULT, | ||
| + | MYSQL_PROTOCOL_PIPE, | ||
| + | }; | ||
| + | </ | ||
| + | typedef struct character_set | ||
| + | { | ||
| + | unsigned int number; /* character set number */ | ||
| + | unsigned int state; /* character set state */ | ||
| + | const char *csname; /* collation name */ | ||
| + | const char *name; /* character set name */ | ||
| + | </ | ||
| + | /* | ||
| + | There are three types of queries - the ones that have to go to | ||
| + | the master, the ones that go to a slave, and the adminstrative | ||
| + | type which must happen on the pivot connectioin | ||
| + | */ | ||
| + | enum mysql_rpl_type | ||
| + | { | ||
| + | MYSQL_RPL_MASTER, | ||
| + | }; | ||
| + | </ | ||
| + | $ sudo cp / | ||
| + | $ sudo vi / | ||
| + | $ diff / | ||
| + | 227,236d226 | ||
| + | < /* | ||
| + | < There are three types of queries - the ones that have to go to | ||
| + | < the master, the ones that go to a slave, and the adminstrative | ||
| + | < type which must happen on the pivot connectioin | ||
| + | < */ | ||
| + | < enum mysql_rpl_type | ||
| + | < { | ||
| + | < | ||
| + | < }; | ||
| + | < | ||
| + | </ | ||
| + | - mysqli の mysqli_api.c がエラーになるので修正する。\\ 145行目以降4カ所: | ||
| + | bind[ofs].buffer = (gptr)& | ||
| + | </ | ||
| + | bind[ofs].buffer = & | ||
| + | </ | ||
| + | $ cp ext/ | ||
| + | $ vi ext/ | ||
| + | $ diff ext/ | ||
| + | 145c145 | ||
| + | < | ||
| + | --- | ||
| + | > | ||
| + | 151c151 | ||
| + | < | ||
| + | --- | ||
| + | > | ||
| + | 601c601 | ||
| + | < | ||
| + | --- | ||
| + | > | ||
| + | 605c605 | ||
| + | < | ||
| + | --- | ||
| + | > | ||
| + | </ | ||
| + | - ビルドしてインストールする。< | ||
| + | $ make | ||
| + | $ sudo make install | ||
| + | </ | ||
| + | |||
| + | ===== ビルドした PHP をテストする ===== | ||
| + | < | ||
| + | $ cp php.ini-dist php.ini | ||
| + | $ vi php.ini | ||
| + | </ | ||
| + | php.ini に extension をロードするように追記する。 | ||
| + | <code ini> | ||
| + | extension=modules/ | ||
| + | </ | ||
| + | テストを実行する。 | ||
| + | < | ||
| + | $ make test | ||
| + | ~省略~ | ||
| + | PASS XMLWriter: libxml2 XML Writer, file buffer, flush [ext/ | ||
| + | PASS XMLWriter: libxml2 XML Writer, membuffer, flush [ext/ | ||
| + | PASS XMLWriter: libxml2 XML Writer, membuffer, flush, text, attribute [ext/ | ||
| + | PASS XMLWriter: libxml2 XML Writer, file buffer, flush [ext/ | ||
| + | PASS XMLWriter: libxml2 XML Writer, comments [ext/ | ||
| + | PASS XMLWriter: libxml2 XML Writer, startDTD/ | ||
| + | FAIL XMLWriter: libxml2 XML Writer, Elements & Attributes [ext/ | ||
| + | PASS XMLWriter: libxml2 XML Writer DTD Element & Attlist [ext/ | ||
| + | FAIL XMLWriter: PI, Comment, CDATA [ext/ | ||
| + | ===================================================================== | ||
| + | TIME END 2012-10-30 23:23:40 | ||
| + | |||
| + | ===================================================================== | ||
| + | TEST RESULT SUMMARY | ||
| + | --------------------------------------------------------------------- | ||
| + | Exts skipped | ||
| + | Exts tested | ||
| + | --------------------------------------------------------------------- | ||
| + | |||
| + | Number of tests : 2264 1666 | ||
| + | Tests skipped | ||
| + | Tests warned | ||
| + | Tests failed | ||
| + | Tests passed | ||
| + | --------------------------------------------------------------------- | ||
| + | Time taken : 52 seconds | ||
| + | ===================================================================== | ||
| + | |||
| + | ===================================================================== | ||
| + | FAILED TEST SUMMARY | ||
| + | --------------------------------------------------------------------- | ||
| + | Testing $argc and $argv handling (GET) [tests/ | ||
| + | Test 7: DTD tests [ext/ | ||
| + | iconv stream filter [ext/ | ||
| + | date_sunrise() and date_sunset() functions [ext/ | ||
| + | Bug #32001 (xml_parse*() goes into infinite loop when autodetection in effect), using UTF-* [ext/ | ||
| + | Bug #35447 (xml_parse_into_struct() chokes on the UTF-8 BOM) [ext/ | ||
| + | XMLReader: libxml2 XML Reader, DTD [ext/ | ||
| + | XMLReader: accessing empty and non existing attributes [ext/ | ||
| + | Bug #38431 (xmlrpc_get_type() crashes PHP on objects) [ext/ | ||
| + | XMLWriter: libxml2 XML Writer, Elements & Attributes [ext/ | ||
| + | XMLWriter: PI, Comment, CDATA [ext/ | ||
| + | XMLWriter: libxml2 XML Writer, Elements & Attributes [ext/ | ||
| + | XMLWriter: PI, Comment, CDATA [ext/ | ||
| + | ===================================================================== | ||
| + | |||
| + | You may have found a problem in PHP. | ||
| + | We would like to send this report automatically to the | ||
| + | PHP QA team, to give us a better understanding of how | ||
| + | the test cases are doing. If you don't want to send it | ||
| + | immediately, | ||
| + | a file that you can send us later. | ||
| + | Do you want to send this report now? [Yns]: s | ||
| + | </ | ||
| + | ===== 参考文献 ===== | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||
| + | [[http:// | ||