- 2012-01-14 (土)
ソースからコンパイルする際
注意点やメモなど
configure オプションについて 確認
configure オプション
http://php.net/manual/ja/configure.about.php注意:
これらのオプションは PHP 4.1.0 の時点でのものです。 しかし、中にはもっと古い PHP 有効なものがあるかもしれません。 古いバージョンをコンパイルされる場合、 おそらくいくつかのオプションは使えないでしょう。
–enable-trans-sid
透過的なセッション ID の伝播を有効にします。PHP 4.1.2 以前でのみ 有効です。PHP 4.2.0 以降、この機能は常に有効となっています。
–enable-memory-limit
メモリ制限(memory limit)のサポートつきでコンパイルします (PHP 5.2.1 以降では使用できず、常に有効となります)。
–disable-url-fopen-wrapper
URL を指定した fopen で、HTTP や FTP を経由してファイルを開く機能を無効にします (PHP 5.2.5 以降では使用できません)。
実際にconfigure
ポイントいくつか
やり直しはキャッシュ削除
http://wiki.livedoor.jp/orangekid2/d/PHP5.2%A4%CE%A5%A4%A5%F3%A5%B9%A5%C8%A1%BC%A5%EB
configure エラー たくさん出るのでその都度orあらかじめ回避
以下はとりあえずメモ。
その都度調べてつぶして行く。
環境やオプションによって何が出るかはその時次第(極めてる人は把握できているのかも)。
エラー内容と解決策、補足、参考URL
configure: warning: –with-apxs2=/usr/sbin/apxs: invalid host type
http://www.boards.ie/vbulletin/showthread.php?t=122040
configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 (found: none).
yum install bison
configure: warning: flex versions supported for regeneration of the Zend/PHP parsers: 2.5.4 (found: none)
yum install flex
configure: warning: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
re2c installed
yum install re2c
No package re2c available.
Error: Nothing to do
apc でも使うらしい
http://blog.goo.ne.jp/hirohito_japan/e/51ea6db428db616e6f73cf028e3ad10e
ここでも詳しい
http://tikushou.blogspot.com/2009_07_01_archive.html
configure: error: xml2-config not found. Please check your libxml2 installation.
yum install libxml2-devel
configure: error: Cannot find OpenSSL’s
‘–with-imap-ssl’ ‘–with-openssl’ 削除
–witch-imap-sslつけろといわれるがつけると
configure: error: Cannot find OpenSSL’s
なので
yum install openssl-devel
checking for BZip2 support… yes
checking for BZip2 in default path… not found
configure: error: Please reinstall the BZip2 distribution
yum-instal bzip2-devel
configure: error: Please reinstall the libcurl distribution -
easy.h should be in
yum install libcurl-devel
If configure fails try –with-jpeg-dir=<DIR>
configure: error: libpng.(a|so) not found.
–witch-jpeg-dir=/usr
phpinfoでconfigure option 取得した
configure: error: libjpeg.(a|so) not found.
yum install libjpeg-devel
configure: error: libpng.(a|so) not found.
yum install libpng-devel
configure: error: Unable to locate gmp.h
yum install gmp-devel
http://d.hatena.ne.jp/u87/20100421/1271830256
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
yum install libc-client-devel
http://www.phpbuilder.com/board/showthread.php?t=10351166
configure: error: This c-client library is built with Kerberos support.
Add –with-kerberos to your configure line. Check config.log for details.
–with-kerberos 追加
configure: error: Kerberos libraries not found.
Check the path given to –with-kerberos (if no path is given, searches in /usr/kerberos, /usr/local and /usr )
whereis krb5 で
/usr/lib/krb5
をpathにしてあげる (試していない)か
yum install krb5-devel (これでエラーなくなった)
configure: error: Cannot find MySQL header files under yes.
yum install mysql-devel
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
–with-pdo-pgsql を
–with-pdo-pgsql=/usr
にしたけどだめ
>includeファイル(ヘッダーファイル)はdevelをインストールしないと含まれないようです
yum install postgresql postgresql-devel
でok
configure: error: Cannot find pspell
–with-pspell を
–with-pspell=shared
したけどだめ
checking for PSPELL support… yes, shared
configure: error: Cannot find pspell
yum install pspell
yum instaoo pspell-devel
などは no packages available
yum list available | grep psppell
したらphp-pspell.i686 がでてきたので
yum install php-pspell
で またエラー
php-pspell の dependancy で aspell がインストールされていたので
yum list availble | grep aspell
した aspell-devel があったので
yum install aspel-devel
でいけた
configure: error: Please reinstall libedit - I cannot find readline.h
yum install libedit-devel
configure: error: snmp.h not found. Check your SNMP installation.
yum install php-snmp
yum install net-snmp-devel
configure: error: Cannot find libtidy
yum install libtidy-devel
configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
yum install libxslt-devel
エラーがなくなったら
+——————————————————————–+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+——————————————————————–+
Thank you for using PHP.
Notice: Following unknown configure options were used:
–with-system-tzdata
–enable-xmlwrite
–with-sqlite3
–enable-phar
Check ‘./configure –help’ for available options
近い!!!!
多分バージョンの違いとかなんとかのはずなので削除
やっと完了
+——————————————————————–+
| License: |
| This software is subject to the PHP License, available in this |
| distribution in the file LICENSE. By continuing this installation |
| process, you are bound by the terms of this license agreement. |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point. |
+——————————————————————–+
Thank you for using PHP.
configure 終わったらmake
make
make test( 結果30/9000 fail)
make install
最終的な configure コマンド
今回の場合です。
Centos6でconfigureすると上記のエラー内容になりますという資料的な意味です。
‘./configure’ ‘–prefix=/usr/local/php-5.2′ ‘–with-apxs2=/usr/sbin/apxs’ ‘–disable-debug’ ‘–with-pic’ ‘–disable-rpath’ ‘–without-pear’ ‘–with-bz2′ ‘–with-png-dir’ ‘–enable-gd-native-ttf’ ‘–without-gdbm’ ‘–with-gettext’ ‘–with-gmp’ ‘–with-iconv’ ‘–with-pcre-regex’ ‘–with-zlib’ ‘–enable-exif’ ‘–enable-ftp’ ‘–enable-magic-quotes’ ‘–enable-sockets’ ‘–enable-calendar’ ‘–without-sqlite’ ‘–enable-xml’ ‘–enable-pcntl’ ‘–with-imap’ ‘–enable-mbstring’ ‘–enable-mbregex’ ‘–with-gd’ ‘–enable-bcmath’ ‘–enable-dba’ ‘–with-db4′ ‘–with-xmlrpc’ ‘–with-ldap’ ‘–with-ldap-sasl’ ‘–with-mysql’ ‘–with-mysqli’ ‘–enable-dom’ ‘–with-pgsql’ ‘–enable-wddx’ ‘–with-snmp’ ‘–enable-soap’ ‘–with-xsl’ ‘–enable-xmlreader’ ‘–with-curl’ ‘–enable-fastcgi’ ‘–enable-pdo’ ‘–with-pdo-mysql=shared’ ‘–with-pdo-pgsql’ ‘–with-pdo-sqlite’ ‘–enable-json’ ‘–enable-zip’ ‘–without-readline’ ‘–with-libedit’ ‘–with-pspell’ ‘–with-tidy’ ‘–with-jpeg-dir=/usr’ ‘–with-kerberos’ ‘–with-imap-ssl’ ‘–with-openssl’
お手軽に現状の確認
php -r “phpinfo();” > info.txt
php -r “phpinfo();” | less
とかで
apxsについて
つけるとモジュール、つけないとCGI?
centos6に yum install php で入れたPHP5.3はモジュール版のはずなのに phpinfo() での configure option には -with-apxs2 ついていなかった。のは何故だろう。
configureの際に–with-apxs2=/usr/local/apache2/bin/apxsを付けない事が重要です。
これを付けるとApacheのモジュール版としてPHPがconfigureされてしまいます。
このオプションをつけなければ勝手にCGI版としてインストールされます。
http://www.ahref.org/tech/server/server-tips/667.html
ふむふむapxsとは
http://kazmax.zpp.jp/apache/apache3.html
http://httpd.apache.org/docs/2.0/programs/apxs.html
whereis apxs
apxs: =>空っぽ
centosにはない?
http://blogs.yahoo.co.jp/ggmky054/9377771.html
http://q.hatena.ne.jp/1153519831
httpd-develを入れると良いらしい
その後
whereis apxs
apxs: /usr/sbin/apxs /usr/share/man/man8/apxs.8.gz
- 次の記事: シェルスクリプト bash 基礎 覚え方
- 前の記事: PHP5.2とPHP5.3を共存させる
Comments:0
Trackback+Pingback:0
- TrackBack URL for this entry
- http://reoto.com/archives/351/trackback/
- Listed below are links to weblogs that reference
- centos6にPHP5.2をソースからコンパイルしてインストール from ぼんずーず