[HOME] [戻る]

玄箱インストールmemo(php)

目次

php-5.0.3

前提条件

php-5.0.3のインストール

tar jxf tgz/php-5.0.3.tar.bz2

cd php-5.0.3
vi Zend/zend.c

    940 #if defined(va_copy)
    941                         va_copy(usr_copy, args);
    942 #else
    943                         usr_copy = args;
    944 #endif

    940 #if defined(va_copy)
    941                         va_copy(usr_copy, args);
    942 #else
    943                         memcpy(usr_copy, args, sizeof(va_list));
    944 #endif

./configure  --with-apxs2=/usr/local/apache2/bin/apxs \
             --enable-mbstring --enable-mbregex \
             --enable-mbstr-enc-trans --enable-shared \
             --with-pgsql=/usr/local/pgsql \
             --enable-cli --with-ncurses --with-readline \
             --with-zlib --with-bz2 \
             --with-gettext --enable-sqlite-utf8
make

make test
=====================================================================
TIME END 2005-02-01 01:07:17
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped    :   63
Exts tested     :   20
---------------------------------------------------------------------

Number of tests : 1291               673
Tests skipped   :  618 (47.9%) --------
Tests warned    :    0 (0.0%) (0.0%)
Tests failed    :   14 (1.1%) (2.1%)
Tests passed    :  659 (51.0%) (97.9%)
---------------------------------------------------------------------
Time taken      :  345 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Test for buffering in core functions with implicit flush off [tests/func/008.phpt]
Convert warnings to exceptions [tests/lang/038.phpt]
Bug #29944 (function defined in switch crashes PHP) [tests/lang/bug29944.phpt]
Bug #22836 (returning references to NULL) [Zend/tests/bug22836.phpt]
Bug #28444 (Cannot access undefined property for object with overloaded property access) [Zend/tests/bug28444.ph
pt]
Test 3: Exception Test [ext/dom/tests/dom003.phpt]
iconv_mime_encode() [ext/iconv/tests/iconv_mime_encode.phpt]
iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
HTML input/output [ext/mbstring/tests/htmlent.phpt]
mb_output_handler() (Shift_JIS) [ext/mbstring/tests/mb_output_handler_shift_jis.phpt]
Bug #29992 (foreach by reference corrupts the array) [ext/standard/tests/array/bug29992.phpt]
Bug #29119 (html_entity_decode() misbehaves with UTF-8) [ext/standard/tests/strings/bug29119.phpt]
Bug #20382 (strtotime ("Monday", $date) produces wrong result on DST changeover) [ext/standard/tests/time/bug203
82.phpt]
Bug #26614 (CDATA sections skipped on line count) [ext/xml/tests/bug26614.phpt]
=====================================================================
こんなものか

su
make install

apache moduleの確認

cd /usr/local/apache2/modules/
ls -lt
-rwxr-xr-x  1 root root  8564756 Feb  1 01:11 libphp5.so
strip libphp5.so
ls -lt
-rwxr-xr-x  1 root root  4164176 Feb  1 01:14 libphp5.so

CLI版の確認

cd /usr/local/bin
ls -lt |head
-rwxr-xr-x  1 root root     820 Feb  1 01:12 php-config
-rwxr-xr-x  1 root root     593 Feb  1 01:12 phpextdist
-rwxr-xr-x  1 root root    3082 Feb  1 01:12 phpize
-rwxr-xr-x  1 root root     666 Feb  1 01:11 pear
-rwxr-xr-x  1 root root 8299156 Feb  1 01:11 php
strip php
ls -lt |head
-rwxr-xr-x  1 root root 3982764 Feb  1 01:17 php
-rwxr-xr-x  1 root root     820 Feb  1 01:12 php-config
-rwxr-xr-x  1 root root     593 Feb  1 01:12 phpextdist
-rwxr-xr-x  1 root root    3082 Feb  1 01:12 phpize
-rwxr-xr-x  1 root root     666 Feb  1 01:11 pear

$ php --version
PHP 5.0.3 (cli) (built: Feb  1 2005 01:00:30)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies

Apacheに組み込み

LoadModule php5_module        modules/libphp5.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

たとえば以下の内容を書いた test.php というファイルを置く。ブラウザからアクセスして確認。

<?php phpinfo() ?>

odinもインストール

$ tar zxf php-5.0.3.tar.gz
$ cd php-5.0.3

vi Zend/zend.c
【修正前】
940: #if defined(va_copy)
941:                         va_copy(usr_copy, args);
942: #else
943:                         usr_copy = args;
944: #endif

【修正後】
940: #if defined(va_copy)
941:                         va_copy(usr_copy, args);
942: #else
943:                         memcpy(usr_copy, args, sizeof(va_list));
944: #endif

./configure  --with-apxs2=/usr/local/apache2/bin/apxs \
             --enable-mbstring --enable-mbregex \
             --enable-mbstr-enc-trans --enable-shared \
             --enable-cli --with-ncurses --with-readline \
             --with-zlib --with-bz2 \
             --with-gettext --enable-sqlite-utf8

Configuring extensions
checking whether to enable LIBXML support... yes
checking libxml2 install dir... no
configure: error: xml2-config not found. Please check your libxml2 installation.

$ tar zxf libxml2-2.6.17.tar.gz
$ cd libxml2-2.6.17
$ ./configure
$ date
Tue Feb  1 23:53:05 JST 2005

$ make && date
...
...
Wed Feb  2 00:31:38 JST 2005

$ su
# make install
# ln -s /usr/local/include/libxml2/libxml /usr/local/include/libxml

$ ./configure  --with-apxs2=/usr/local/apache2/bin/apxs \
               --enable-mbstring --enable-mbregex \
               --enable-mbstr-enc-trans --enable-shared \
               --enable-cli --with-ncurses --with-readline \
               --with-zlib --with-bz2 \
               --with-gettext --enable-sqlite-utf8
configure: error: Wrong ncurses lib version or lib not found
$ ./configure  --with-apxs2=/usr/local/apache2/bin/apxs \
               --enable-mbstring --enable-mbregex \
               --enable-mbstr-enc-trans --enable-shared \
               --enable-cli --with-readline \
               --with-zlib --with-bz2 \
               --with-gettext --enable-sqlite-utf8
configure: error: readline library not found

2005/02/01
ご意見・ご感想は,こちらの掲示板 まで.