何はなくともPHPをインストール
インストールされてるか確認する
[cc lang=’text’ ]
[user@foo src]$ yum list | grep php
[/cc]
うん、無い。
もしインストール済みなかこんな感じで
インストール済みのパッケージをがーーっと削除。
[cc lang=’text’ ]
[root@foo ~]# yum remove php
[root@foo ~]# yum remove php-*
[/cc]
最新のソースをGET
[cc lang=’text’ ]
[user@foo src]$ wget http://www.php.net/get/php-5.3.6.tar.gz/from/us.php.net/mirror
[/cc]
解凍してー
[cc lang=’text’ ]
[user@foo src]$ tar -zxvf php-5.3.6.tar.gz
[/cc]
移動
[cc lang=’text’ ]
[user@foo src]$ cd php-5.3.6
[/cc]
他サーバーでインストール済みのPHPのconfigureを確認する
[cc lang=’text’ ]
# php -i | grep configure
[/cc]
んで出てきた内容がこれ
[cc lang=’text’ ]
‘–with-apxs2=/usr/local/apache2/bin/apxs’
‘–enable-mbstring’
‘–enable-mbregex’
‘–enable-zend-multibyte’
‘–enable-ftp’
‘–with-gd’
‘–enable-gd-native-ttf’
‘–with-freetype-dir=/usr/lib’
‘–with-png-dir=/usr/lib’
‘–with-zlib-dir=/usr/lib’
‘–with-jpeg-dir=/usr/lib’
‘–with-mysql=/usr’
‘–with-iconv’
‘–with-kerberos’
‘–with-openssl’
‘–with-pear’
‘–with-dom=/usr/lib’
‘–with-dom-xslt=/usr/lib’
‘–with-curl=/usr/lib’
‘–enable-pcntl’
[/cc]
–with-dom 絡みはPHP4向けの古いオプションっぽいのではずす。
–with-zlib 圧縮関係を扱えるように追加する。
configureでMySQLのエラーが出たので
[cc lang=’text’ ]
configure: error: Cannot find libmysqlclient under /usr.
Note that the MySQL client library is not bundled anymore!
[/cc]
–with-mysql=/usr/bin/ yum で入れたmysqlなので場所が違う
–with-libdir=lib64 64bit用ライブラリの場所指定?
も変更。
[cc lang=’text’ ]
#./configure \
–with-apxs2=/usr/local/apache2/bin/apxs \
–enable-mbstring \
–enable-mbregex \
–enable-zend-multibyte \
–enable-ftp \
–with-gd \
–enable-gd-native-ttf \
–with-freetype-dir=/usr/lib \
–with-png-dir=/usr/lib \
–with-zlib-dir=/usr/lib \
–with-jpeg-dir=/usr/lib \
–with-mysql=/usr/bin/ \
–with-libdir=lib64 \
–with-iconv \
–with-kerberos \
–with-openssl \
–with-imap-ssl \
–with-pear \
–with-curl=/usr/lib \
–with-zlib \
–enable-pcntl
[/cc]
configure 実行でエラー
[cc lang=’text’ ]
configure: error: xml2-config not found. Please check your libxml2 installation.
[/cc]
怒られた通りに libxml2 をインストール
[cc lang=’text’ ]
[root@foo ~]# yum install libxml2 libxml2-devel
[/cc]
再度 configure
また怒られた。
[cc lang=’text’ ]
configure: error: Please reinstall the libcurl distribution –
easy.h should be in
[/cc]
curl がねぇよってことでまたも yum から
[cc lang=’text’ ]
[root@foo ~]# yum install curl-devel
[/cc]
やり直し
[cc lang=’text’ ]
configure: error: libjpeg.(a|so) not found.
[/cc]
怒られた。
jpegのライブラリがねぇよと。
画像系まとめて入れる。
yum から install
[cc lang=’text’ ]
[root@foo ~]# yum install libjpeg-devel libpng-devel
[/cc]
…やり直し
今度のエラー
[cc lang=’text’ ]
configure: error: freetype.h not found.
[/cc]
わーったって。
[cc lang=’text’ ]
[root@foo ~]# yum install freetype-devel
[/cc]
やっと無事完了。
configure の前に
[cc lang=’text’ ]
[root@foo ~]# yum install libxml2-devel curl-devel libjpeg-devel libpng-devel freetype-devel
[/cc]
ってやっとけば良かったって事ですな。
んでコンパイル実施
[cc lang=’text’ ]
[user@foo php-5.3.6]$ make
[/cc]
makeも無事完了でmake test
[cc lang=’text’ ]
[user@foo php-5.3.6]$ make test
[/cc]
テスト結果はこう
[cc lang=’text’ ]
=====================================================================
EXPECTED FAILED TEST SUMMARY
———————————————————————
output buffering – fatalism [tests/output/ob_011.phpt] XFAIL REASON: This test will fail until the fix in revision r214155 is backported from php 6
Inconsistencies when accessing protected members [Zend/tests/access_modifiers_008.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Inconsistencies when accessing protected members – 2 [Zend/tests/access_modifiers_009.phpt] XFAIL REASON: Discussion: http://marc.info/?l=php-internals&m=120221184420957&w=2
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_2.phpt] XFAIL REASON: See Bug #48770
Bug #48770 (call_user_func_array() fails to call parent from inheriting class) [Zend/tests/bug48770_3.phpt] XFAIL REASON: See Bug #48770
DateInterval::format(), %a [ext/date/tests/DateInterval_format_a.phpt] XFAIL REASON: Windows VC6 libs floor()/ceil() choke on floats
DateTime::diff() add() sub() — fall type2 type2 [ext/date/tests/DateTime_diff_add_sub-fall-type2-type2.phpt] XFAIL REASON: PHP < 5.4 has bugs DateTime::diff() add() sub() -- fall type2 type3 [ext/date/tests/DateTime_diff_add_sub-fall-type2-type3.phpt] XFAIL REASON: PHP < 5.4 has bugs DateTime::diff() add() sub() -- fall type3 type2 [ext/date/tests/DateTime_diff_add_sub-fall-type3-type2.phpt] XFAIL REASON: PHP < 5.4 has bugs DateTime::diff() add() sub() -- fall type3 type3 [ext/date/tests/DateTime_diff_add_sub-fall-type3-type3.phpt] XFAIL REASON: PHP < 5.4 has bugs DateTime::diff() add() sub() -- spring type2 type2 [ext/date/tests/DateTime_diff_add_sub-spring-type2-type2.phpt] XFAIL REASON: PHP < 5.4 has bugs DateTime::diff() add() sub() -- spring type2 type3 [ext/date/tests/DateTime_diff_add_sub-spring-type2-type3.phpt] XFAIL REASON: PHP < 5.4 has bugs DateTime::diff() add() sub() -- spring type3 type2 [ext/date/tests/DateTime_diff_add_sub-spring-type3-type2.phpt] XFAIL REASON: PHP < 5.4 has bugs DateTime::diff() add() sub() -- spring type3 type3 [ext/date/tests/DateTime_diff_add_sub-spring-type3-type3.phpt] XFAIL REASON: PHP < 5.4 has bugs SimpleXML: array casting bug [ext/simplexml/tests/034.phpt] XFAIL REASON: Does anyone know why? ===================================================================== ===================================================================== WARNED TEST SUMMARY --------------------------------------------------------------------- via [ext/pdo_sqlite/tests/common.phpt] SQLite PDO Common: Bug #34630 (inserting streams as LOBs) [ext/pdo_sqlite/tests/bug_34630.phpt] (warn: XFAIL section but test passes) via [ext/sqlite/tests/pdo/common.phpt] SQLite2 PDO Common: Bug #34630 (inserting streams as LOBs) [ext/sqlite/tests/pdo/bug_34630.phpt] (warn: XFAIL section but test passes) Bug #39863 (file_exists() silently truncates after a null byte) [ext/standard/tests/file/bug39863.phpt] (warn: XFAIL section but test passes) ===================================================================== [/cc] Bug絡みのメッセージばっかなのでOKとしておこう ってか [cc lang='text' ] SimpleXML: array casting bug [ext/simplexml/tests/034.phpt] XFAIL REASON: Does anyone know why? [/cc] 聞かれても。知らんがな。 とにかくinstall [cc lang='text' ] [root@foo php-5.3.6]# make install Installing PHP SAPI module: apache2handler /usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules /usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/ cp .libs/libphp5.so /usr/local/apache2/modules/libphp5.so cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la libtool: install: warning: remember to run `libtool --finish /home/user/src/php-5.3.6/libs' chmod 755 /usr/local/apache2/modules/libphp5.so [activating module `php5' in /usr/local/apache2/conf/httpd.conf] Installing PHP CLI binary: /usr/local/bin/ Installing PHP CLI man page: /usr/local/man/man1/ Installing build environment: /usr/local/lib/php/build/ Installing header files: /usr/local/include/php/ Installing helper programs: /usr/local/bin/ program: phpize program: php-config Installing man pages: /usr/local/man/man1/ page: phpize.1 page: php-config.1 Installing PEAR environment: /usr/local/lib/php/ [PEAR] Archive_Tar - installed: 1.3.7 [PEAR] Console_Getopt - installed: 1.3.0 [PEAR] Structures_Graph- installed: 1.0.4 [PEAR] XML_Util - installed: 1.2.1 [PEAR] PEAR - installed: 1.9.2 Wrote PEAR system config file at: /usr/local/etc/pear.conf You may want to add: /usr/local/lib/php to your php.ini include_path /home/user/src/php-5.3.6/build/shtool install -c ext/phar/phar.phar /usr/local/bin ln -s -f /usr/local/bin/phar.phar /usr/local/bin/phar Installing PDO headers: /usr/local/include/php/ext/pdo/ [/cc] インストール完了ってことで一応バージョン確認 [cc lang='text' ] [root@foo php-5.3.6]# php -v PHP 5.3.6 (cli) (built: Jun 16 2011 19:59:40) Copyright (c) 1997-2011 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies [/cc] ちゃんと最新版入ってますな。