Web ARENAにAPCをインストール
9 / 16 / 2009

# pecl install APC

を使ってインストール。

WARNING: channel “pecl.php.net” has updated its protocols, use “channel-update pecl.php.net” to update

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 92160 bytes) in /usr/share/pear/PEAR/Dependency2.php on line 396
Allowed memory size of 8388608 bytes exhausted (tried to allocate 0 bytes)

メモリは足りないと言われたので/usr/share/pear/pearcmd.phpに

@ini_set(’memory_limit’, ‘16M’);

と書く。

downloading APC-3.0.19.tgz …
Starting to download APC-3.0.19.tgz (115,735 bytes)
…………………….done: 115,735 bytes
47 source files, building
running: phpize
sh: phpize: command not found
ERROR: `phpize’ failed

phpizeが無いと言われた。

yum -y install php-devel
yum -y install httpd-devel

downloading APC-3.0.19.tgz …
Starting to download APC-3.0.19.tgz (115,735 bytes)
………….done: 115,735 bytes
47 source files, building
running: phpize
configure.in:9: warning: underquoted definition of PHP_WITH_PHP_CONFIG
run info ‘(automake)Extending aclocal’
or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
configure.in:32: warning: underquoted definition of PHP_EXT_BUILDDIR
configure.in:33: warning: underquoted definition of PHP_EXT_DIR
configure.in:34: warning: underquoted definition of PHP_EXT_SRCDIR
configure.in:35: warning: underquoted definition of PHP_ALWAYS_SHARED
acinclude.m4:19: warning: underquoted definition of PHP_PROG_RE2C
configure.in:65: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
ERROR: `phpize’ failed

これはよくわからん。どうやらautomake1.8の仕業

http://www.doyouphp.jp/inst/inst_automake.shtml

ここにかいてある通りに修正する。ばしょは/usr/lib64/php/build/phpize.m4でした。

configure.in:65: error: possibly undefined macro: AC_PROG_LIBTOOL

これがまだのこっているので、

yum -y install libtool libtool-libs libtool-libs13

とする。

もう一回試すとCコンパイラが無いと言われたので、

yum install gcc gcc-c++

とする。今度こそ!

Build process completed successfully
Installing ‘/var/tmp/pear-build-root/install-APC-3.0.19//usr/lib64/php4/apc.so’
install ok: channel://pecl.php.net/APC-3.0.19
You should add “extension=apc.so” to php.ini

できた!

php.iniにextension=apc.so

を追加しておしまい。

使えるねっとのVPSにAPCをインストール
5 / 19 / 2009

yumがインストールされている。そして、

# pecl install APC

を使ってインストールしたい。

# yum install php-pear
# yum -y install php-devel
# yum -y install automake

インストールしてみると、

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 92160 bytes) in /usr/share/pear/PEAR/PackageFile/v2/Validator.php on line 1831

メモリた足りないと言われたので、/usr/share/pear/pearcmd.phpに@ini_set(‘memory_limit’, ‘16M’); と書く。

configure: error: no acceptable C compiler found in $PATH

今度はCコンパイラが無いと言われる

# yum install gcc gcc-c++

三度目の正直。

Sorry, I was not able to successfully run APXS.  Possible reasons:

1.  Perl is not installed;
2.  Apache was not compiled with DSO support (–enable-module=so);
3.  ‘apxs’ is not in your path.  Try to use –with-apxs=/path/to/apxs
The output of /var/tmp/pear-build-root/APC-3.0.19/?yes follows
/tmp/tmpXvVSb8/APC-3.0.19/configure: line 3232: /var/tmp/pear-build-root/APC-3.0.19/?yes: No such file or directory
configure: error: Aborting
ERROR: `/tmp/tmpXvVSb8/APC-3.0.19/configure –with-apxs=?yes’ failed

んーよくわからない。

# yum -y install httpd-devel
# yum install apr-devel

今度こそ。

Build process completed successfully
Installing ‘/var/tmp/pear-build-root/install-APC-3.0.19//usr/lib64/php/modules/apc.so’
install ok: channel://pecl.php.net/APC-3.0.19
You should add “extension=apc.so” to php.ini

出来た!php.iniにextension=apc.soを追加する。

#  /etc/init.d/httpd restart

Apacheを再起動して、phpinfo()で確認。

無事動いた!

参考にしたサイト:
http://d.hatena.ne.jp/ir9Ex/20081019/1224366629
http://labs.uechoco.com/blog/2008/04/phppecl.html
http://yosiwo.lowtech.ne.jp/item/375
http://plaza.rakuten.co.jp/chibimatsuzaki/diary/200812260000/

You

are currently browsing the notizbloc blog archives for the tag APC