ホーム » openSUSE

PHP APC(Altenattive PHP Cache) 2

Submitted by on 2009年12月18日 – 21:29コメントはありません。

アップデート後、APCがダメなようで再インストール。
現在の環境

openSUSE 11.2 (x86_64)
Linux 2.6.31.5-0.1-default x86_64
Apache 2.2.13-2.3.1
PHP 5.3.0-2.4.3

libidn-devel(x86-64) = 1.10-4.2
libapr1-devel(x86-64) = 1.3.8-2.3
libapr-util1-devel(x86-64) = 1.3.9-2.1
readline-devel(x86-64) = 6.0-18.4.1
libxml2-devel(x86-64) = 2.7.3-2.2
libopenssl-devel(x86-64) = 0.9.8k-3.5.3
libcurl-devel(x86-64) = 7.19.6-2.1
apache2-devel(x86-64) = 2.2.13-2.3.1

autoconf(x86-64) = 2.63-5.2
automake(x86-64) = 1.11-6.2
make(x86-64) = 3.81-130.2
gcc(x86-64) = 4.4-4.2
binutils(x86-64) = 2.19.51-10.26.4
php5-devel(x86-64) = 5.3.0-2.4.3
libmysqlclient-devel(x86-64) = 5.1.36-6.7.2

APC-3.1.3はmake後

APC-3.1.3/php_apc.c:37:21: error: apc_bin.h: No such file or directory                                                                               
 APC-3.1.3/php_apc.c: In function 'zm_startup_apc':            
 APC-3.1.3/php_apc.c:272: error: 'APC_BIN_VERIFY_MD5' undeclared (first use in this function)                                                         
 APC-3.1.3/php_apc.c:272: error: (Each undeclared identifier is reported only once                                                                    
 APC-3.1.3/php_apc.c:272: error: for each function it appears in.)                                                                                    
 APC-3.1.3/php_apc.c:273: error: 'APC_BIN_VERIFY_CRC32' undeclared (first use in this function)                                                       
 APC-3.1.3/php_apc.c: In function 'zif_apc_bin_dump':          
 APC-3.1.3/php_apc.c:1313: error: 'apc_bd_t' undeclared (first use in this function)                                                                  
 APC-3.1.3/php_apc.c:1313: error: 'bd' undeclared (first use in this function)                                                                        
 APC-3.1.3/php_apc.c: In function 'zif_apc_bin_dumpfile':      
 APC-3.1.3/php_apc.c:1351: error: 'apc_bd_t' undeclared (first use in this function)                                                                  
 APC-3.1.3/php_apc.c:1351: error: 'bd' undeclared (first use in this function)                                                                        
 APC-3.1.3/php_apc.c: In function 'zif_apc_bin_load':          
 APC-3.1.3/php_apc.c:1429: error: 'apc_bd_t' undeclared (first use in this function)                                                                  
 APC-3.1.3/php_apc.c:1429: error: expected expression before ')' token                                                                                
 APC-3.1.3/php_apc.c:1430: error: expected expression before ')' token                                                                                
 APC-3.1.3/php_apc.c:1434: error: expected expression before ')' token                                                                                
 APC-3.1.3/php_apc.c: In function 'zif_apc_bin_loadfile':      
 APC-3.1.3/php_apc.c:1482: error: 'apc_bd_t' undeclared (first use in this function)                                                                  
 APC-3.1.3/php_apc.c:1482: error: expected expression before ')' token                                                                                
 APC-3.1.3/php_apc.c:1483: error: expected expression before ')' token                                                                                
 APC-3.1.3/php_apc.c:1488: error: expected expression before ')' token
make: *** [php_apc.lo] エラー 1

で失敗しました。
APC-3.1.3p1でやり直し

# wget http://pecl.php.net/get/APC-3.1.3p1.tgz           
--2009-12-18 20:01:09--  http://pecl.php.net/get/APC-3.1.3p1.tgz                      
pecl.php.net をDNSに問いあわせています… 216.92.131.66                               
pecl.php.net|216.92.131.66|:80 に接続しています… 接続しました。                     
HTTP による接続要求を送信しました、応答を待っています… 200 OK                       
長さ: 142277 (139K) [application/octet-stream]                                        
`APC-3.1.3p1.tgz' に保存中                                                            

100%[=============================================>] 142,277     97.9K/s 時間 1.4s   

2009-12-18 20:01:11 (97.9 KB/s) - `APC-3.1.3p1.tgz' へ保存完了 [142277/142277]
# tar -zxvf APC-3.1.3p1.tgz
package.xml                                             
APC-3.1.3p1/tests/apc_001.phpt                          
APC-3.1.3p1/tests/apc_002.phpt                          
APC-3.1.3p1/tests/apc_003.phpt
省略
APC-3.1.3p1/pgsql_s_lock.h                              
APC-3.1.3p1/apc_fcntl_win32.c                           
APC-3.1.3p1/apc_rfc1867.c                               
APC-3.1.3p1/apc.php
# cd APC-3.1.3p1/
APC-3.1.3p1 # phpize
Configuring for:                                
PHP Api Version:         20090626               
Zend Module Api No:      20090626               
Zend Extension Api No:   220090626              
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_static_works, …): suspicious cache-id, must contain _cv_ to be cached                                             
../../lib/autoconf/general.m4:1974: AC_CACHE_VAL is expanded from…
省略
aclocal.m4:3510: AC_LIBTOOL_COMPILER_OPTION is expanded from…                       
aclocal.m4:7620: AC_LIBTOOL_PROG_COMPILER_PIC is expanded from…                     
configure.in:150: warning: AC_CACHE_VAL(lt_prog_compiler_pic_works_CXX, …): suspicious cache-id, must contain _cv_ to be cached                                            
aclocal.m4:5606: _LT_AC_LANG_CXX_CONFIG is expanded from…                           
aclocal.m4:5605: AC_LIBTOOL_LANG_CXX_CONFIG is expanded from…                       
aclocal.m4:4641: _LT_AC_TAGCONFIG is expanded from…
APC-3.1.3p1 # export CPPFLAGS="-I/usr/include/apache2 -DAPC_PHP5_STAT"
APC-3.1.3p1 # ./configure --enable-apc --enable-apc-mmap --with-php-config=/usr/bin/php-config --with-apxs=/usr/sbin/apxs2
configure: WARNING: unrecognized options: --with-apxs                                 
checking for grep that handles long lines and -e… /usr/bin/grep                     
checking for egrep… /usr/bin/grep -E                                                
checking for a sed that does not truncate output… /usr/bin/sed                      
checking for cc… cc                                                                 
checking for C compiler default output file name… a.out                             
checking whether the C compiler works… yes
省略
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status        
config.status: creating config.h           
configure: WARNING: unrecognized options: --with-apxs
APC-3.1.3p1 # make
/bin/sh /APC-3.1.3p1/libtool --mode=compile cc  -I. -I/APC-3.1.3p1 -DPHP_ATOM_INC -I/APC-3.1.3p1/include -I/APC-3.1.3p1/main -I/APC-3.1.3p1 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib  -I/usr/include/apache2 -DAPC_PHP5_STAT -DHAVE_CONFIG_H  -g -O2   -c /APC-3.1.3p1/apc.c -o apc.lo                                                                                 
mkdir .libs                                                                           
 cc -I. -I/APC-3.1.3p1 -DPHP_ATOM_INC -I/APC-3.1.3p1/include -I/APC-3.1.3p1/main -I/APC-3.1.3p1 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/include/apache2 -DAPC_PHP5_STAT -DHAVE_CONFIG_H -g -O2 -c /APC-3.1.3p1/apc.c  -fPIC -DPIC -o .libs/apc.o
省略
Libraries have been installed in:
   /APC-3.1.3p1/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.
APC-3.1.3p1 # make install
Installing shared extensions:     /usr/lib64/php5/extensions/

/etc/php5/apache2/php.ini

[apc]
apc.optimization = 1
apc.mode = mmap
apc.cachedir = /var/cache/apc
apc.check_compiled_source = 1
apc.check_mtime = 1

/etc/php5/conf.d/apc.ini

extension=apc.so

Apacheの再起動

# /etc/init.d/apache2 restart

人気度: 4% [?]