トップ 差分 一覧 ソース 検索 ヘルプ PDF RSS ログイン

Debian(Sarge):Prius/2006-10-7

この記事は古いです
こちらを参照→ http://goungoun.dip.jp/app/fswiki/wiki.cgi/debianetch

目次

負荷軽減対策実施

PC全体の負荷が重たくなってきたので、チューニングする。

PHP

eAccelerator導入

PHPのスクリプト実行を高速化する
eAccelerator をインストール

hotsanic

負荷軽減の為、監視周期を変更

[Debian(Sarge):Prius/2006-3-31] を参照

MySQL

参考

【MySQLウォッチ】第14回 サーバー設定を見直してMySQLの性能を引き出す:ITpro:
http://itpro.nikkeibp.co.jp/members/ITPro/oss/20050213/156109/?P=2

MySQL/最適化 - Linux Tips:
http://linux.mini13i.gotdns.org/MySQL%2F%BA%C7%C5%AC%B2%BD.html

Project MultiBurst: MySQLのチューニングソフト「mMeasure」をインストール:
http://www.multiburst.net/project-multiburst/archives/2006/07/31/1119.php

チューニング項目

■MyISAMキーバッファ

インデックスの読み込みにあたって利用されるバッファ

バッファミス率
=ディスクから読んだ回数 / 総読み込み数
=Key_reads / Key_read_requests

1.0%〜 不足
0.1%〜 やや不足
〜0.1% 適切

key_buffer_size を増減する。
■クエリーキャッシュ

キャッシュ使用%
=(総キャッシュサイズ - 未使用サイズ) / 総キャッシュサイズ
=(query_cache_size - Qcache_free_memory) / query_cache_size

95%〜 不足
85%〜 やや不足
60%〜 適切

query_cache_size を増減する。
■接続数

接続数%
=Max_used_connections / max_connections
=過去発生した最大接続数 / 許容接続数

95%〜 不足
85%〜 やや不足
40%〜 適切

max_connections を増減する。

# Threads_connected:現在の接続数
■テーブルキャッシュ

キャッシュ使用%
=Open_tables / table_cache
=使用テーブル数 / 総キャッシュテーブル数

98%〜 不足
86%〜 やや不足
40%〜 適切

table_cache を増減する。

現状確認

=Key_reads / Key_read_requests
=23406 / 20023755
=0.12%(やや不足)
key_buffer_size(現在16777216) をやや増やすべき
=(query_cache_size - Qcache_free_memory) / query_cache_size
=(16777216  - 10959360) / 16777216 
=35%(適切か多いぐらい)
=Max_used_connections / max_connections
=30 / 100
=33%(適切)
=Open_tables / table_cache
=64 / 64
=100%(不足)
table_cache(table_cache)を増やすべき

チューニング実施(vi /etc/mysql/my.cnf)

xxxx@prius:~$ sudo vi /etc/mysql/my.cnf
:
#### mod 2006/10/08
####key_buffer          = 16M
key_buffer              = 24M
max_allowed_packet      = 16M
thread_stack            = 128K

#### add 2006/10/08
#### default 64
table_cache             = 512

#### add 2006/10/08
#### default 0
thread_cache_size       = 10
:

APC-3.0.12p2(インストール断念)

APCをソースからインストールします。

実際は、うまく動作させることができなかったので断念しましたが。

開発環境インストール

コンパイルする必要があるので環境を作る。
php4、apache2の開発環境をインストールする。

パッケージ確認

xxxx@prius:~$ apt-cache show php4-dev
Package: php4-dev
Priority: optional
Section: devel
Installed-Size: 1916
Maintainer: Adam Conrad <adconrad@0c3.net>
Architecture: i386
Source: php4
Version: 4:4.3.10-16
Depends: autoconf, automake1.4, libssl-dev, php4-common (>= 4:4.3.10-16)
Conflicts: libtool (= 1.4b-1), libtool (= 1.4b-2), libtool (= 1.4b-3)
Filename: pool/main/p/php4/php4-dev_4.3.10-16_i386.deb
Size: 325322
MD5sum: cc9fa332fb4a3bcf50e18fe7dfc30ce5
SHA1: a8124763a409e1742d30c0321922d8a304a682b5
SHA256: a93ad9cf100dd90d67b75d769e7376424174f8a24fef7d5b16aff36b39bb386c
Description: Files for PHP4 module development
 This package provides the files from the PHP4 source needed for compiling
 additional modules.
 .
 PHP4 is an HTML-embedded scripting language. Much of its syntax is borrowed
 from C, Java and Perl with a couple of unique PHP-specific features thrown
 in. The goal of the language is to allow web developers to write
 dynamically generated pages quickly.
 .
 The most significant change between php3 and php4 is the new parser engine
 called Zend, which boosts performance quite impressively.
xxxx@prius:~$ apt-cache show apache2-prefork-dev
Package: apache2-prefork-dev
Priority: optional
Section: devel
Installed-Size: 760
Maintainer: Debian Apache Maintainers <debian-apache@lists.debian.org>
Architecture: i386
Source: apache2
Version: 2.0.54-5sarge1
Depends: apache2-common (= 2.0.54-5sarge1), libapr0-dev (= 2.0.54-5sarge1), libssl-dev, openssl, bzip2, autoconf, autotools-dev, libtool, libdb4.2-dev, zlib1g-dev, libpcre3-dev
Conflicts: apache2-mpm-worker (<< 2.0.42-1), apache2-mpm-prefork (<< 2.0.42-1), apache2-mpm-perchild (<< 2.0.42-1), apache2-mpm-threadpool (<< 2.0.42-1), apache2-dev
Filename: pool/main/a/apache2/apache2-prefork-dev_2.0.54-5sarge1_i386.deb
Size: 168868
MD5sum: 9905d2bd31aaf49cb4c522a7130fc53e
SHA1: f54c5933e42f0361bb32cb9c934d90fe17ea8a0e
SHA256: 7ead4da59264424d2978ac6e0d010211004bfea3a95c545a70aa91ce857acbe7
Description: development headers for apache2
 This package provides the development headers for non-threaded apache2,
 see the apache2 package description for more details.
 .
 This should only be used when you absolutely *have* to have a non-threaded
 environment, ie for PHP4.

xxxx@prius:~$

apt-get install php4-dev

念のため、テスト

xxxx@prius:~$ sudo apt-get -s install php4-dev
Password:
パッケージリストを読みこんでいます... 完了
依存関係ツリーを作成しています... 完了
以下の特別パッケージがインストールされます:
  autoconf automake1.4 autotools-dev libssl-dev libssl0.9.7 m4
提案パッケージ:
  autoconf2.13 autobook autoconf-archive gnu-standards
以下のパッケージが新たにインストールされます:
  autoconf automake1.4 autotools-dev libssl-dev m4 php4-dev
以下のパッケージはアップグレードされます:
  libssl0.9.7
アップグレード: 1 個、新規インストール: 6 個、削除: 0 個、保留: 3 個。
Inst libssl0.9.7 [0.9.7e-3sarge3] (0.9.7e-3sarge4 Debian-Security:3.1/stable)
Inst m4 (1.4.2-1 Debian:3.1r3/stable)
Inst autoconf (2.59a-3 Debian:3.1r3/stable)
Inst autotools-dev (20050422.1 Debian:3.1r3/stable)
Inst automake1.4 (1:1.4-p6-9 Debian:3.1r3/stable)
Inst libssl-dev (0.9.7e-3sarge4 Debian-Security:3.1/stable)
Inst php4-dev (4:4.3.10-16 Debian:3.1r3/stable, Debian-Security:3.1/stable)
Conf libssl0.9.7 (0.9.7e-3sarge4 Debian-Security:3.1/stable)
Conf m4 (1.4.2-1 Debian:3.1r3/stable)
Conf autoconf (2.59a-3 Debian:3.1r3/stable)
Conf autotools-dev (20050422.1 Debian:3.1r3/stable)
Conf automake1.4 (1:1.4-p6-9 Debian:3.1r3/stable)
Conf libssl-dev (0.9.7e-3sarge4 Debian-Security:3.1/stable)
Conf php4-dev (4:4.3.10-16 Debian:3.1r3/stable, Debian-Security:3.1/stable)
xxxx@prius:~$

本番インストール

xxxx@prius:~$ sudo apt-get install php4-dev
パッケージリストを読みこんでいます... 完了
依存関係ツリーを作成しています... 完了
以下の特別パッケージがインストールされます:
  autoconf automake1.4 autotools-dev libssl-dev libssl0.9.7 m4
提案パッケージ:
  autoconf2.13 autobook autoconf-archive gnu-standards
以下のパッケージが新たにインストールされます:
  autoconf automake1.4 autotools-dev libssl-dev m4 php4-dev
以下のパッケージはアップグレードされます:
  libssl0.9.7
アップグレード: 1 個、新規インストール: 6 個、削除: 0 個、保留: 3 個。
5958kB のアーカイブを取得する必要があります。
展開後に追加で 12.3MB のディスク容量が消費されます。
続行しますか? [Y/n] Y
取得:1 ftp://ftp.jp.debian.org sarge/main m4 1.4.2-1 [104kB]
取得:2 ftp://ftp.jp.debian.org sarge/main autoconf 2.59a-3 [381kB]
取得:3 ftp://ftp.jp.debian.org sarge/main autotools-dev 20050422.1 [55.9kB]
取得:4 http://security.debian.org sarge/updates/main libssl0.9.7 0.9.7e-3sarge4 [2265kB]
取得:5 ftp://ftp.jp.debian.org sarge/main automake1.4 1:1.4-p6-9 [272kB]
取得:6 ftp://ftp.jp.debian.org sarge/main php4-dev 4:4.3.10-16 [325kB]
取得:7 http://security.debian.org sarge/updates/main libssl-dev 0.9.7e-3sarge4 [2555kB]
5958kB を 48s で取得しました (122kB/s)
パッケージを事前設定しています ...
(データベースを読み込んでいます... 現在 21715 個のファイルとディレクトリがインストールされています。)
libssl0.9.7 0.9.7e-3sarge3 を(.../libssl0.9.7_0.9.7e-3sarge4_i386.deb で)置換するための準備をしています...
libssl0.9.7 を展開し、置換しています...
未選択パッケージ m4 を選択しています。
(.../archives/m4_1.4.2-1_i386.deb から) m4 を展開しています...
未選択パッケージ autoconf を選択しています。
(.../autoconf_2.59a-3_all.deb から) autoconf を展開しています...
未選択パッケージ autotools-dev を選択しています。
(.../autotools-dev_20050422.1_all.deb から) autotools-dev を展開しています...
未選択パッケージ automake1.4 を選択しています。
(.../automake1.4_1%3a1.4-p6-9_all.deb から) automake1.4 を展開しています...
未選択パッケージ libssl-dev を選択しています。
(.../libssl-dev_0.9.7e-3sarge4_i386.deb から) libssl-dev を展開しています...
未選択パッケージ php4-dev を選択しています。
(.../php4-dev_4%3a4.3.10-16_i386.deb から) php4-dev を展開しています...
libssl0.9.7 (0.9.7e-3sarge4) を設定しています ...

m4 (1.4.2-1) を設定しています ...

autoconf (2.59a-3) を設定しています ...

autotools-dev (20050422.1) を設定しています ...
automake1.4 (1.4-p6-9) を設定しています ...

libssl-dev (0.9.7e-3sarge4) を設定しています ...

php4-dev (4.3.10-16) を設定しています ...

xxxx@prius:~$

apt-get install apache2-prefork-dev

念のため、テスト

xxxx@prius:~$ sudo apt-get -s install apache2-prefork-dev
パッケージリストを読みこんでいます... 完了
依存関係ツリーを作成しています... 完了
以下の特別パッケージがインストールされます:
  binutils bzip2 gcc gcc-3.3 libapr0-dev libc6-dev libdb4.2-dev libexpat1-dev
  libldap2-dev libpcre3-dev libtool linux-kernel-headers zlib1g-dev
提案パッケージ:
  binutils-doc make manpages-dev flex bison gdb gcc-doc gcc-3.3-doc glibc-doc
  db4.2-doc libtool-doc g77 fortran77-compiler gcj
推奨パッケージ:
  libltdl3-dev
以下のパッケージが新たにインストールされます:
  apache2-prefork-dev binutils bzip2 gcc gcc-3.3 libapr0-dev libc6-dev
  libdb4.2-dev libexpat1-dev libldap2-dev libpcre3-dev libtool
  linux-kernel-headers zlib1g-dev
アップグレード: 0 個、新規インストール: 14 個、削除: 0 個、保留: 3 個。
Inst binutils (2.15-6 Debian:3.1r3/stable)
Inst gcc-3.3 (1:3.3.5-13 Debian:3.1r3/stable)
Inst gcc (4:3.3.5-3 Debian:3.1r3/stable)
Inst linux-kernel-headers (2.5.999-test7-bk-17 Debian:3.1r3/stable)
Inst libc6-dev (2.3.2.ds1-22sarge4 Debian:3.1r3/stable)
Inst libdb4.2-dev (4.2.52-18 Debian:3.1r3/stable)
Inst libpcre3-dev (4.5-1.2sarge1 Debian:3.1r3/stable, Debian-Security:3.1/stable)
Inst libldap2-dev (2.1.30-8 Debian:3.1r3/stable)
Inst libexpat1-dev (1.95.8-3 Debian:3.1r3/stable)
Inst libtool (1.5.6-6 Debian:3.1r3/stable)
Inst libapr0-dev (2.0.54-5sarge1 Debian:3.1r3/stable, Debian-Security:3.1/stable)
Inst bzip2 (1.0.2-7 Debian:3.1r3/stable)
Inst zlib1g-dev (1:1.2.2-4.sarge.2 Debian:3.1r3/stable, Debian-Security:3.1/stable)
Inst apache2-prefork-dev (2.0.54-5sarge1 Debian:3.1r3/stable, Debian-Security:3.1/stable)
Conf binutils (2.15-6 Debian:3.1r3/stable)
Conf gcc-3.3 (1:3.3.5-13 Debian:3.1r3/stable)
Conf gcc (4:3.3.5-3 Debian:3.1r3/stable)
Conf linux-kernel-headers (2.5.999-test7-bk-17 Debian:3.1r3/stable)
Conf libc6-dev (2.3.2.ds1-22sarge4 Debian:3.1r3/stable)
Conf libdb4.2-dev (4.2.52-18 Debian:3.1r3/stable)
Conf libpcre3-dev (4.5-1.2sarge1 Debian:3.1r3/stable, Debian-Security:3.1/stable)
Conf libldap2-dev (2.1.30-8 Debian:3.1r3/stable)
Conf libexpat1-dev (1.95.8-3 Debian:3.1r3/stable)
Conf libtool (1.5.6-6 Debian:3.1r3/stable)
Conf libapr0-dev (2.0.54-5sarge1 Debian:3.1r3/stable, Debian-Security:3.1/stable)
Conf bzip2 (1.0.2-7 Debian:3.1r3/stable)
Conf zlib1g-dev (1:1.2.2-4.sarge.2 Debian:3.1r3/stable, Debian-Security:3.1/stable)
Conf apache2-prefork-dev (2.0.54-5sarge1 Debian:3.1r3/stable, Debian-Security:3.1/stable)
xxxx@prius:~$

本番インストール

xxxx@prius:~$ sudo apt-get install apache2-prefork-dev
パッケージリストを読みこんでいます... 完了
依存関係ツリーを作成しています... 完了
以下の特別パッケージがインストールされます:
  binutils bzip2 gcc gcc-3.3 libapr0-dev libc6-dev libdb4.2-dev libexpat1-dev
  libldap2-dev libpcre3-dev libtool linux-kernel-headers zlib1g-dev
提案パッケージ:
  binutils-doc make manpages-dev flex bison gdb gcc-doc gcc-3.3-doc glibc-doc
  db4.2-doc libtool-doc g77 fortran77-compiler gcj
推奨パッケージ:
  libltdl3-dev
以下のパッケージが新たにインストールされます:
  apache2-prefork-dev binutils bzip2 gcc gcc-3.3 libapr0-dev libc6-dev
  libdb4.2-dev libexpat1-dev libldap2-dev libpcre3-dev libtool
  linux-kernel-headers zlib1g-dev
アップグレード: 0 個、新規インストール: 14 個、削除: 0 個、保留: 3 個。
10.4MB のアーカイブを取得する必要があります。
展開後に追加で 34.7MB のディスク容量が消費されます。
続行しますか? [Y/n] Y
取得:1 ftp://ftp.jp.debian.org sarge/main binutils 2.15-6 [2221kB]
取得:2 ftp://ftp.jp.debian.org sarge/main gcc-3.3 1:3.3.5-13 [1570kB]
取得:3 ftp://ftp.jp.debian.org sarge/main gcc 4:3.3.5-3 [4906B]
取得:4 ftp://ftp.jp.debian.org sarge/main linux-kernel-headers 2.5.999-test7-bk-17 [1377kB]
取得:5 ftp://ftp.jp.debian.org sarge/main libc6-dev 2.3.2.ds1-22sarge4 [2535kB]
取得:6 ftp://ftp.jp.debian.org sarge/main libdb4.2-dev 4.2.52-18 [465kB]
取得:7 ftp://ftp.jp.debian.org sarge/main libpcre3-dev 4.5-1.2sarge1 [106kB]
取得:8 ftp://ftp.jp.debian.org sarge/main libldap2-dev 2.1.30-8 [226kB]
取得:9 ftp://ftp.jp.debian.org sarge/main libexpat1-dev 1.95.8-3 [126kB]
取得:10 ftp://ftp.jp.debian.org sarge/main libtool 1.5.6-6 [607kB]
取得:11 ftp://ftp.jp.debian.org sarge/main libapr0-dev 2.0.54-5sarge1 [260kB]
取得:12 ftp://ftp.jp.debian.org sarge/main bzip2 1.0.2-7 [233kB]
取得:13 ftp://ftp.jp.debian.org sarge/main zlib1g-dev 1:1.2.2-4.sarge.2 [488kB]
取得:14 ftp://ftp.jp.debian.org sarge/main apache2-prefork-dev 2.0.54-5sarge1 [169kB]
10.4MB を 12s で取得しました (828kB/s)
未選択パッケージ binutils を選択しています。
(データベースを読み込んでいます... 現在 23283 個のファイルとディレクトリがインストールされています。)
(.../binutils_2.15-6_i386.deb から) binutils を展開しています...
未選択パッケージ gcc-3.3 を選択しています。
(.../gcc-3.3_1%3a3.3.5-13_i386.deb から) gcc-3.3 を展開しています...
未選択パッケージ gcc を選択しています。
(.../gcc_4%3a3.3.5-3_i386.deb から) gcc を展開しています...
未選択パッケージ linux-kernel-headers を選択しています。
(.../linux-kernel-headers_2.5.999-test7-bk-17_i386.deb から) linux-kernel-headers を展開しています...
未選択パッケージ libc6-dev を選択しています。
(.../libc6-dev_2.3.2.ds1-22sarge4_i386.deb から) libc6-dev を展開しています...
未選択パッケージ libdb4.2-dev を選択しています。
(.../libdb4.2-dev_4.2.52-18_i386.deb から) libdb4.2-dev を展開しています...
未選択パッケージ libpcre3-dev を選択しています。
(.../libpcre3-dev_4.5-1.2sarge1_i386.deb から) libpcre3-dev を展開しています...
未選択パッケージ libldap2-dev を選択しています。
(.../libldap2-dev_2.1.30-8_i386.deb から) libldap2-dev を展開しています...
未選択パッケージ libexpat1-dev を選択しています。
(.../libexpat1-dev_1.95.8-3_i386.deb から) libexpat1-dev を展開しています...
未選択パッケージ libtool を選択しています。
(.../libtool_1.5.6-6_i386.deb から) libtool を展開しています...
未選択パッケージ libapr0-dev を選択しています。
(.../libapr0-dev_2.0.54-5sarge1_i386.deb から) libapr0-dev を展開しています...
未選択パッケージ bzip2 を選択しています。
(.../bzip2_1.0.2-7_i386.deb から) bzip2 を展開しています...
未選択パッケージ zlib1g-dev を選択しています。
(.../zlib1g-dev_1%3a1.2.2-4.sarge.2_i386.deb から) zlib1g-dev を展開しています...
未選択パッケージ apache2-prefork-dev を選択しています。
(.../apache2-prefork-dev_2.0.54-5sarge1_i386.deb から) apache2-prefork-dev を展開しています...
binutils (2.15-6) を設定しています ...

gcc-3.3 (3.3.5-13) を設定しています ...
gcc (3.3.5-3) を設定しています ...

linux-kernel-headers (2.5.999-test7-bk-17) を設定しています ...
libc6-dev (2.3.2.ds1-22sarge4) を設定しています ...
libdb4.2-dev (4.2.52-18) を設定しています ...
libpcre3-dev (4.5-1.2sarge1) を設定しています ...
libldap2-dev (2.1.30-8) を設定しています ...
libexpat1-dev (1.95.8-3) を設定しています ...

libtool (1.5.6-6) を設定しています ...

libapr0-dev (2.0.54-5sarge1) を設定しています ...
bzip2 (1.0.2-7) を設定しています ...

zlib1g-dev (1.2.2-4.sarge.2) を設定しています ...
apache2-prefork-dev (2.0.54-5sarge1) を設定しています ...
xxxx@prius:~$

インストール

ソースダウンロード&解凍

ソースダウンロード

xxxx@prius:~/src/php-apc$ wget http://pecl.php.net/get/APC-3.0.12p2.tgz
--01:52:50--  http://pecl.php.net/get/APC-3.0.12p2.tgz
           => `APC-3.0.12p2.tgz'
pecl.php.net をDNSに問いあわせています... 216.92.131.66
pecl.php.net[216.92.131.66]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 94,809 [application/octet-stream]

100%[====================================>] 94,809        81.53K/s

01:52:52 (81.40 KB/s) - `APC-3.0.12p2.tgz' を保存しました [94809/94809]

xxxx@prius:~/src/php-apc$

解凍

xxxx@prius:~/src/php-apc$ tar xvfz APC-3.0.12p2.tgz
package.xml
APC-3.0.12p2/tests/apc_001.phpt
APC-3.0.12p2/tests/apc_002.phpt
APC-3.0.12p2/tests/apc_003.phpt
APC-3.0.12p2/tests/skipif.inc
APC-3.0.12p2/CHANGELOG
APC-3.0.12p2/INSTALL
APC-3.0.12p2/LICENSE
APC-3.0.12p2/NOTICE
APC-3.0.12p2/TODO
APC-3.0.12p2/TECHNOTES.txt
APC-3.0.12p2/apc.c
APC-3.0.12p2/apc.dsp
APC-3.0.12p2/apc.h
APC-3.0.12p2/apc_cache.c
APC-3.0.12p2/apc_cache.h
APC-3.0.12p2/apc_compile.c
APC-3.0.12p2/apc_compile.h
APC-3.0.12p2/apc_debug.c
APC-3.0.12p2/apc_debug.h
APC-3.0.12p2/apc_fcntl.c
APC-3.0.12p2/apc_fcntl.h
APC-3.0.12p2/apc_globals.h
APC-3.0.12p2/apc_lock.h
APC-3.0.12p2/apc_main.c
APC-3.0.12p2/apc_main.h
APC-3.0.12p2/apc_mmap.c
APC-3.0.12p2/apc_optimizer.c
APC-3.0.12p2/apc_optimizer.h
APC-3.0.12p2/apc_pair.c
APC-3.0.12p2/apc_pair.h
APC-3.0.12p2/apc_php.h
APC-3.0.12p2/apc_sem.c
APC-3.0.12p2/apc_sem.h
APC-3.0.12p2/apc_shm.c
APC-3.0.12p2/apc_shm.h
APC-3.0.12p2/apc_sma.c
APC-3.0.12p2/apc_sma.h
APC-3.0.12p2/apc_stack.c
APC-3.0.12p2/apc_stack.h
APC-3.0.12p2/apc_zend.c
APC-3.0.12p2/apc_zend.h
APC-3.0.12p2/config.m4
APC-3.0.12p2/php_apc.c
APC-3.0.12p2/php_apc.h
APC-3.0.12p2/apc_fcntl_win32.c
APC-3.0.12p2/apc.php
xxxx@prius:~/src/php-apc$

cat ./APC-3.0.12p2/INSTALL

xxxx@prius:~/src/php-apc$ cat ./APC-3.0.12p2/INSTALL
Installation Instructions for APC
---------------------------------

This version of APC should work on PHP 4.3.0 - 4.4.x and
5.1.0 - 5.1.x.  Yes, that means PHP 5.0.x is no longer
supported.  Upgrade to PHP 5.1.x.  You will notice all sorts
of performance increases.

CVS Instructions
----------------
Building from CVS can be done like this:

  cvs -d :pserver:cvsread@cvs.php.net:/repository login
  Password: phpfi
  cvs -d :pserver:cvsread@cvs.php.net:/repository co pecl/apc
  cd pecl/apc
  phpize
  ./configure --enable-apc-mmap --with-apxs --with-php-config=/usr/local/php/bin/php-config
  make
  make install

Suggested Configuration (in your php.ini file)
----------------------------------------------
  extension=apc.so
  apc.enabled=1
  apc.shm_segments=1
  apc.optimization=0
  apc.shm_size=128
  apc.ttl=7200
  apc.user_ttl=7200
  apc.num_files_hint=1024
  apc.mmap_file_mask=/tmp/apc.XXXXXX
  apc.enable_cli=1

These are fully described at the bottom of this file.

PHP 4 Optimization
------------------
If you are trying to get every little bit of speed out of PHP4+APC, you need
to tell APC where to find your httpd.h file and also add -DAPC_PHP4_STAT to
your CPPFLAGS.  (if you don't have httpd.h, install the apache_dev package
for your OS) and do:
  export CPPFLAGS="-I/usr/include/apache-1.3 -DAPC_PHP4_STAT" (for bash on Debian)
  setenv CPPFLAGS "-I/usr/include/apache-1.3 -DAPC_PHP4_STAT" (for tsch on Debian)
and then re-run your configure script.

This optimization saves a stat syscall on the main script file.  In PHP5 this
optimization is automatic and doesn't need any special build flags.

The second thing you are going to want to do to save another syscall is to
compile using the --with-apxs configure switch.  This should work for both
Apache1 and Apache2.  Point it directly at your apxs2 script for Apache2.
eg. --with-apxs=/usr/local/bin/apxs2

+---------------------+
| QUICK INSTALL (DSO) |
+---------------------+

These instructions assume your PHP installation is located in /usr/local/php and you
want Apache optimizations (--with-apxs).

$ gunzip -c apc_x.y.tar.gz | tar xf -
$ cd apc_x.y
$ /usr/local/php/bin/phpize
$ ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/local/php/bin/php-config
$ make
$ make install

You will probably need to run the final command (make install) as root.

The above sequence of commands will install a .so file in your PHP
installation extension directory. The output of make install should display
that path to the screen.

Next you must edit your php.ini file, which is normally located in
/usr/local/php/lib/php.ini, and add the following line:

    extension="apc.so"

Replace "/path/to/php/extensions" with whatever path was displayed when you
ran make install above.

Then restart your web server and consult the output of phpinfo(). If there is
an informational section for APC, the installation was successful.

+------------------------+
| QUICK INSTALL (Static) |
+------------------------+

APC will not successfully compile on all systems as a DSO. If you run into
problems using the DSO quick install, you can try to compile it statically
into PHP. (The DSO install is recommended, though.)

These instructions assume the current directory is the root of the PHP source
tree, and that you have already configured PHP by running its bundled
configure script.

$ cd ext
$ gunzip -c apc_x.y.tar.gz | tar xf -
$ cd ..
$ ./buildconf
$ ./config.nice
$ make
$ make install

Once this is complete, simply restart your web server. You do not need to
modify your php.ini file to enable APC.

+-----------------+
| VERBOSE INSTALL |
+-----------------+

These instructions assume your PHP installation is located in /usr/local/php.

1.  Unpack your distribution file.

    You will have downloaded a file named something like apc_x.y.tar.gz.
    Unzip this file with a command like

        gunzip apc_x.y.tar.gz

    Next you have to untar it with

        tar xvf apc_x.y.tar

    This will create an apc_x.y directory. cd into this new directory:

        cd apc_x.y

2.  Run phpize.

    phpize is a script that should have been installed with PHP, and is
    normally located in /usr/local/php/bin assuming you installed PHP in
    /usr/local/php. (If you do not have the phpize script, you must reinstall
    PHP and be sure not to disable PEAR.)

    Run the phpize command:

        /usr/local/php/bin/phpize

    Its output should resemble this:

        autoheader: `config.h.in' is created
        You should update your `aclocal.m4' by running aclocal.
        Configuring for:
          PHP Api Version:   20020918
          Zend Module Api No:   20020429
          Zend Extension Api No:   20021010

    phpize should create a configure script in the current directory. If you
    get errors instead, you might be missing some required development tools,
    such as autoconf or libtool. You can try downloading the latest versions
    of those tools and running phpize again.

3.  Run the configure script.

    phpize creates a configure script. The only option you need to specify is
    the location of your php-config script:

        ./configure --enable-apc

    php-config should be located in the same directory as phpize.

    If you prefer to use mmap instead of the default IPC shared memory support,
    add --enable-apc-mmap to your configure line.

        If you prefer to use sysv IPC semaphores over the safer fcntl() locks, add
        --enable-sem to your configure line.  If you don't have a problem
        with your server segaulting, or any other unnatural accumulation of
        semaphores on your system, the semaphore based locking is slightly faster.

4.  Compile and install the files. Simply type: make install

    (You may need to be root in order to install)

    If you encounter errors from libtool or gcc during this step, please
    contact the project maintainer (dcowgill@php.net).

5.  Edit your php.ini

    make install should have printed a line resembling the following:

        Installing shared extensions: /path/to/extension/

    Copy the path /path/to/extension/ and add the following line to your
    php.ini file (normally located in /usr/local/php/lib/php.ini):

        extension="apc.so"

    If you don't have a php.ini file in that location, you can create it now.

6.  Restart the web server and test the installation.

    Restart your web server now (for apache, it's apachectl restart) and
    create a small test PHP file in your document root. The file should
    contain just the following line:

        <?php phpinfo() ?>

    Request that file in a web browser. If there is an entry for APC in the
    list of installed modules, the installation was successful.

    If APC is not listed, consult your web server error log. If it contains an
    error message saying that it can't load the APC extension, your system
    might not be able to load shared libraries created with PHP's build
    system. One alternative would be to compile APC statically into PHP. See
    the Quick Install (Static) instructions above.

    You should consult your error log anyway to see if APC generated any
    errors. On BSD-based platforms, it is typical for APC to be unable to
    allocate the default-sized shared memory segment. See below for hints on
    raising your system's shared memory limitations.

+-----------------+
| CONFIGURING APC |
+-----------------+

Although the default APC settings are fine for many installations, serious
users should consider tuning the following parameters:

    OPTION                  DESCRIPTION
    ------------------      --------------------------------------------------
    apc.enabled             This can be set to 0 to disable APC. This is
                            primarily useful when APC is statically compiled
                            into PHP, since there is no other way to disable
                            it (when compiled as a DSO, the zend_extension
                            line can just be commented-out).
                            (Default: 1)

    apc.shm_segments        The number of shared memory segments to allocate
                            for the compiler cache. If APC is running out of
                            shared memory but you have already set
                            apc.shm_size as high as your system allows, you
                            can try raising this value.
                            (Default: 1)

    apc.shm_size            The size of each shared memory segment in MB.
                            By default, some systems (including most BSD
                            variants) have very low limits on the size of a
                            shared memory segment.
                            (Default: 30)

    apc.optimization        The optimization level. Zero disables the
                            optimizer, and higher values use more aggressive
                            optimizations. Expect very modest speed
                            improvements. This is experimental.
                            (Default: 0)

    apc.num_files_hint      A "hint" about the number of distinct source files
                            that will be included or requested on your web
                            server. Set to zero or omit if you're not sure;
                            this setting is mainly useful for sites that have
                            many thousands of source files.
                            (Default: 1000)

    apc.user_entries_hint   Just like num_files_hint, a "hint" about the number
                            of distinct user cache variables to store.
                            Set to zero or omit if you're not sure;
                            (Default: 100)

    apc.ttl                 The number of seconds a cache entry is allowed to
                            idle in a slot in case this cache entry slot is
                            needed by another entry.  Leaving this at zero
                            means that your cache could potentially fill up
                            with stale entries while newer entries won't be
                            cached.
                            (Default: 0)

    apc.user_ttl            The number of seconds a user cache entry is allowed
                            to idle in a slot in case this cache entry slot is
                            needed by another entry.  Leaving this at zero
                            means that your cache could potentially fill up
                            with stale entries while newer entries won't be
                            cached.
                            (Default: 0)


    apc.gc_ttl              The number of seconds that a cache entry may
                            remain on the garbage-collection list. This value
                            provides a failsafe in the event that a server
                            process dies while executing a cached source file;
                            if that source file is modified, the memory
                            allocated for the old version will not be
                            reclaimed until this TTL reached. Set to zero to
                            disable this feature.
                            (Default: 3600)

    apc.cache_by_default    On by default, but can be set to off and used in
                            conjunction with positive apc.filters so that files
                            are only cached if matched by a positive filter.
                            (Default: On)

    apc.filters             A comma-separated list of POSIX extended regular
                            expressions. If any pattern matches the source
                            filename, the file will not be cached. Note that
                            the filename used for matching is the one passed
                            to include/require, not the absolute path.  If the
                            first character of the expression is a + then the
                            expression will be additive in the sense that any
                            files matched by the expression will be cached, and
                            if the first character is a - then anything matched
                            will not be cached.  The - case is the default, so
                            it can be left off.
                            (Default: "")

    apc.mmap_file_mask      If compiled with MMAP support by using --enable-mmap
                            this is the mktemp-style file_mask to pass to the
                            mmap module for determing whether your mmap'ed memory
                            region is going to be file-backed or shared memory
                            backed.  For straight file-backed mmap, set it to
                            something like /tmp/apc.XXXXXX (exactly 6 X's).
                            To use POSIX-style shm_open/mmap put a ".shm"
                            somewhere in your mask.  eg.  "/apc.shm.XXXXXX"
                            You can also set it to "/dev/zero" to use your
                            kernel's /dev/zero interface to anonymous mmap'ed
                            memory.  Leaving it undefined will force an
                            anonymous mmap.
                                                                      (Default: "")

    apc.slam_defense        On very busy servers whenever you start the server or
                            modify files you can create a race of many processes
                            all trying to cache the same file at the same time.
                            This option sets the percentage of processes that will
                            skip trying to cache an uncached file.  Or think of it
                            as the probability of a single process to skip caching.
                            For example, setting this to 75 would mean that there is
                            a 75% chance that the process will not cache an uncached
                            file.  So the higher the setting the greater the defense
                            against cache slams.  Setting this to 0 disables this
                            feature.
                            (Default: 0)

    apc.file_update_protection
                            When you modify a file on a live web server you really
                            should do so in an atomic manner.  That is, write to a
                            temporary file and rename (mv) the file into its permanent
                            position when it is ready.  Many text editors, cp, tar and
                            other such programs don't do this.  This means that there
                            is a chance that a file is accessed (and cached) while it
                            is still being written to.  This file_update_protection
                            setting puts a delay on caching brand new files.  The
                            default is 2 seconds which means that if the modification
                            timestamp (mtime) on a file shows that it is less than 2
                            seconds old when it is accessed, it will not be cached.
                            The unfortunate person who accessed this half-written file
                            will still see weirdness, but at least it won't persist.
                            If you are certain you always atomically update your files
                            by using something like rsync which does this correctly, you
                            can turn this protection off by setting it to 0.  If you
                            have a system that is flooded with io causing some update
                            procedure to take longer than 2 seconds, you may want to
                            increase this a bit.
                            (Default: 2)

    apc.enable_cli          Mostly for testing and debugging.  Setting this enables APC
                            for the CLI version of PHP.  Normally you wouldn't want to
                            create, populate and tear down the APC cache on every CLI
                            request, but for various test scenarios it is handy to be
                            able to enable APC for the CLI version of APC easily.
                            (Default: 0)

    apc.max_file_size       Prevents large files from being cached.
                            (Default: 1M)

    apc.stat                Whether to stat the main script file and the fullpath
                            includes.  If you turn this off you will need to restart
                            your server in order to update scripts.
                            (Default: 1)
xxxx@prius:~/src/php-apc$

コンパイル

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ export CPPFLAGS="-I/usr/include/apache2 -DAPC_PHP4_STAT"
xxxx@prius:~/src/php-apc/APC-3.0.12p2$ /usr/bin/phpize
Configuring for:
PHP Api Version:         20020918
Zend Module Api No:      20020429
Zend Extension Api No:   20021010
xxxx@prius:~/src/php-apc/APC-3.0.12p2$ ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config --with-apxs=/usr/bin/apxs2
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM
checking for PHP extension directory... /usr/lib/php4/20020429
checking for re2c... exit 0;
checking for gawk... no
checking for mawk... mawk
checking whether apc needs to get compiler flags from apxs... yes
checking whether to enable APC support... yes, shared
checking Checking whether we should use mmap... yes
checking Checking whether we should use semaphore locking instead of fcntl... no
checking for union semun... no
checking for shm_open in -lrt... yes
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check
See `config.log' for more details.
xxxx@prius:~/src/php-apc/APC-3.0.12p2$

エラー発生
ログ確認

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ vi config.log
:
configure:5429: /lib/cpp -I/usr/include/apache2 -DAPC_PHP4_STAT conftest.cc
cpp: installation problem, cannot exec `cc1plus': No such file or directory
:

cc1plus コマンドが無いらしい。
Debianサイトにて cc1plus を含むパッケージを検索する。

You have searched for cc1plus in stable, architecture i386.
Found 11 matching files/directories, displaying files/directories 1 to 11.

FILE                                                       PACKAGE

usr/h8300-hitachi-hms/lib/gcc-lib/h8300-hitachi-hms/2.95.2/cc1plus devel/gcc-h8300-hms
usr/lib/gcc-lib/arm-palmos/3.2.2/cc1plus		    otherosfs/prc-tools-arm
usr/lib/gcc-lib/i386-linux/2.95.4/cc1plus		    devel/g++-2.95
usr/lib/gcc-lib/i486-linux/3.3.5/cc1plus		    devel/g++-3.3
usr/lib/gcc-lib/i486-linuxlibc1/2.7.2.3/cc1plus		    oldlibs/altgcc
usr/lib/gcc-lib/m68k-palmos/2.95.3-kgpd/cc1plus		    otherosfs/prc-tools-m68k
usr/lib/gcc/i486-linux/3.4.4/cc1plus			    devel/g++-3.4
usr/lib/u++/cc1plus					    devel/u++
usr/libexec/gcc/arm-wince-pe/3.4.2/cc1plus		    devel/pocketpc-g++
usr/libexec/gcc/avr/3.4.3/cc1plus			    devel/gcc-avr
usr/libexec/gcc/i586-mingw32msvc/3.4.2/cc1plus		    devel/mingw32

g++ パッケージを探す。

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ apt-cache search ".*" | egrep "^g\+\+"
g++ - The GNU C++ compiler
g++-2.95 - The GNU C++ compiler
g++-3.3 - The GNU C++ compiler
g++-3.4 - The GNU C++ compiler

念のため、g++ が未インストールであることを確認

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ dpkg -l | egrep "^g\+\+"
xxxx@prius:~/src/php-apc/APC-3.0.12p2$

g++ パッケージインストール

まずパッケージ内容確認

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ apt-cache show g++
Package: g++
Priority: standard
Section: devel
Installed-Size: 8
Maintainer: Debian GCC maintainers <debian-gcc@lists.debian.org>
Architecture: i386
Source: gcc-defaults (1.21)
Version: 4:3.3.5-3
Provides: c++-compiler
Depends: cpp (>= 4:3.3.5-3), gcc (>= 4:3.3.5-3), g++-3.3 (>= 1:3.3.5-1), gcc-3.3 (>= 1:3.3.5-1)
Filename: pool/main/g/gcc-defaults/g++_3.3.5-3_i386.deb
Size: 1398
MD5sum: 7ef6ba5dd128a333eeea2ed26a6f63d3
SHA1: 1c9313fab331bc870a9beda11bbc3e587e28fb56
SHA256: 4b8ab900503156bc6f49446d94834ce9311e071ba0830d0a65941c62ed7f72ab
Description: The GNU C++ compiler
 This is the GNU C++ compiler, a fairly portable optimizing compiler for C++.
 .
 This is a dependency package providing the default GNU C++ compiler.

xxxx@prius:~/src/php-apc/APC-3.0.12p2$

テストインストール

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ sudo apt-get -s install g++
Password:
パッケージリストを読みこんでいます... 完了
依存関係ツリーを作成しています... 完了
以下の特別パッケージがインストールされます:
  g++-3.3 libstdc++5-3.3-dev
提案パッケージ:
  gcc-3.3-doc libstdc++5-3.3-doc stl-manual
以下のパッケージが新たにインストールされます:
  g++ g++-3.3 libstdc++5-3.3-dev
アップグレード: 0 個、新規インストール: 3 個、削除: 0 個、保留: 3 個。
Inst libstdc++5-3.3-dev (1:3.3.5-13 Debian:3.1r3/stable) []
Inst g++-3.3 (1:3.3.5-13 Debian:3.1r3/stable)
Inst g++ (4:3.3.5-3 Debian:3.1r3/stable)
Conf g++-3.3 (1:3.3.5-13 Debian:3.1r3/stable)
Conf libstdc++5-3.3-dev (1:3.3.5-13 Debian:3.1r3/stable)
Conf g++ (4:3.3.5-3 Debian:3.1r3/stable)
xxxx@prius:~/src/php-apc/APC-3.0.12p2$

本番インストール

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ sudo apt-get install g++
パッケージリストを読みこんでいます... 完了
依存関係ツリーを作成しています... 完了
以下の特別パッケージがインストールされます:
  g++-3.3 libstdc++5-3.3-dev
提案パッケージ:
  gcc-3.3-doc libstdc++5-3.3-doc stl-manual
以下のパッケージが新たにインストールされます:
  g++ g++-3.3 libstdc++5-3.3-dev
アップグレード: 0 個、新規インストール: 3 個、削除: 0 個、保留: 3 個。
2555kB のアーカイブを取得する必要があります。
展開後に追加で 8417kB のディスク容量が消費されます。
続行しますか? [Y/n] Y
取得:1 ftp://ftp.jp.debian.org sarge/main libstdc++5-3.3-dev 1:3.3.5-13 [775kB]
取得:2 ftp://ftp.jp.debian.org sarge/main g++-3.3 1:3.3.5-13 [1779kB]
取得:3 ftp://ftp.jp.debian.org sarge/main g++ 4:3.3.5-3 [1398B]
2555kB を 2s で取得しました (897kB/s)
未選択パッケージ libstdc++5-3.3-dev を選択しています。
(データベースを読み込んでいます... 現在 25466 個のファイルとディレクトリがインストールされています。)
(.../libstdc++5-3.3-dev_1%3a3.3.5-13_i386.deb から) libstdc++5-3.3-dev を展開しています...
未選択パッケージ g++-3.3 を選択しています。
(.../g++-3.3_1%3a3.3.5-13_i386.deb から) g++-3.3 を展開しています...
未選択パッケージ g++ を選択しています。
(.../g++_4%3a3.3.5-3_i386.deb から) g++ を展開しています...
g++-3.3 (3.3.5-13) を設定しています ...
libstdc++5-3.3-dev (3.3.5-13) を設定しています ...
g++ (3.3.5-3) を設定しています ...

xxxx@prius:~/src/php-apc/APC-3.0.12p2$

再度コンパイル実施

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config --with-apxs=/usr/bin/apxs2
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM
checking for PHP extension directory... /usr/lib/php4/20020429
checking for re2c... exit 0;
checking for gawk... no
checking for mawk... mawk
checking whether apc needs to get compiler flags from apxs... yes
checking whether to enable APC support... yes, shared
checking Checking whether we should use mmap... yes
checking Checking whether we should use semaphore locking instead of fcntl... no
checking for union semun... no
checking for shm_open in -lrt... yes
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
configure: creating ./config.status
config.status: creating config.h
xxxx@prius:~/src/php-apc/APC-3.0.12p2$

今度はエラーなく完了。

次はmake

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ make
-bash: make: command not found

makeが無いのでインストール

xxxx@prius:~/src/php-apc/APC-3.0.12p2$
xxxx@prius:~/src/php-apc/APC-3.0.12p2$
xxxx@prius:~/src/php-apc/APC-3.0.12p2$ sudo apt-get -s install make
:
xxxx@prius:~/src/php-apc/APC-3.0.12p2$ sudo apt-get install make
:

再度make

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ make
:
In file included from /usr/include/apache2/httpd.h:30,
                 from /home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c:45:
/usr/include/apache2/ap_config.h:20:17: apr.h: No such file or directory
/usr/include/apache2/ap_config.h:21:23: apr_hooks.h: No such file or directory
/usr/include/apache2/ap_config.h:22:32: apr_optional_hooks.h: No such file or directory


エラー出た。

Debianサイトで arp.h を探す。

You have searched for apr.h in stable, architecture i386.
Found 1 matching files/directories, displaying files/directories 1 to 1.

FILE                                                       PACKAGE

usr/include/apr-0/apr.h					    libdevel/libapr0-dev

-I でインクルードパスを指定して、念のため最初から作業を行う。

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ export CPPFLAGS="-I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT"
xxxx@prius:~/src/php-apc/APC-3.0.12p2$ /usr/bin/phpize
Configuring for:
PHP Api Version:         20020918
Zend Module Api No:      20020429
Zend Extension Api No:   20021010
xxxx@prius:~/src/php-apc/APC-3.0.12p2$ ./configure --enable-apc --enable-apc-mmap --with-apxs --with-php-config=/usr/bin/php-config --with-apxs=/usr/bin/apxs2
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM
checking for PHP extension directory... /usr/lib/php4/20020429
checking for re2c... exit 0;
checking for gawk... no
checking for mawk... mawk
checking whether apc needs to get compiler flags from apxs... yes
checking whether to enable APC support... yes, shared
checking Checking whether we should use mmap... yes
checking Checking whether we should use semaphore locking instead of fcntl... no
checking for union semun... no
checking for shm_open in -lrt... yes
checking for a sed that does not truncate output... /bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
xxxx@prius:~/src/php-apc/APC-3.0.12p2$

でmake

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ make
:
/home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c:116: warning: implicit declaration of function `XtOffsetOf'
/home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c:116: error: syntax error before "zend_apc_globals"
/home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c:116: error: initializer element is not constant
/home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c:116: error: (near initialization for `ini_entries[0].mh_arg1')
:

エラー出た。

ネット検索して以下を見つけた。
http://pecl.php.net/bugs/bug.php?id=5584

ということで、
apc_main.c、php_apc.c の

#undef XtOffsetOf

の行をコメントにする。

で再度make

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ make
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c -o php_apc.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c  -fPIC -DPIC -o .libs/php_apc.o
/home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c: In function `_apc_define_constants':
/home/xxxx/src/php-apc/APC-3.0.12p2/php_apc.c:547: warning: dereferencing type-punned pointer will break strict-aliasing rules
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_cache.c -o apc_cache.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_cache.c  -fPIC -DPIC -o .libs/apc_cache.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c -o apc_compile.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c  -fPIC -DPIC -o .libs/apc_compile.o
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c: In function `my_copy_class_entry':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c:641: warning: unused variable `i'
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c: In function `apc_copy_new_functions':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c:1344: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c: In function `apc_copy_new_classes':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c:1414: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c: In function `my_check_copy_function':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c:2185: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c: In function `my_check_copy_default_property':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_compile.c:2208: warning: dereferencing type-punned pointer will break strict-aliasing rules
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_debug.c -o apc_debug.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_debug.c  -fPIC -DPIC -o .libs/apc_debug.o
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_debug.c: In function `optimizer_zend_util_opcode_to_string':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_debug.c:192: warning: unused variable `S_DARG_LOAD_CONSTANT'
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_debug.c:193: warning: unused variable `S_DARG_INCDEC_VAR'
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_debug.c: In function `dump':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_debug.c:542: warning: too many arguments for format
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_fcntl.c -o apc_fcntl.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_fcntl.c  -fPIC -DPIC -o .libs/apc_fcntl.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_main.c -o apc_main.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_main.c  -fPIC -DPIC -o .libs/apc_main.o
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_main.c: In function `install_class':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_main.c:153: warning: dereferencing type-punned pointer will break strict-aliasing rules
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_mmap.c -o apc_mmap.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_mmap.c  -fPIC -DPIC -o .libs/apc_mmap.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_optimizer.c -o apc_optimizer.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_optimizer.c  -fPIC -DPIC -o .libs/apc_optimizer.o
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_optimizer.c: In function `rewrite_constant_resolve':
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_optimizer.c:352: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_optimizer.c:356: warning: dereferencing type-punned pointer will break strict-aliasing rules
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_optimizer.c: At top level:
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_optimizer.c:653: warning: `is_pure_binary_op' defined but not used
/home/xxxx/src/php-apc/APC-3.0.12p2/apc_optimizer.c:687: warning: `peephole_post_inc' defined but not used
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_pair.c -o apc_pair.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_pair.c  -fPIC -DPIC -o .libs/apc_pair.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_sem.c -o apc_sem.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_sem.c  -fPIC -DPIC -o .libs/apc_sem.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_shm.c -o apc_shm.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_shm.c  -fPIC -DPIC -o .libs/apc_shm.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_sma.c -o apc_sma.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_sma.c  -fPIC -DPIC -o .libs/apc_sma.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_stack.c -o apc_stack.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_stack.c  -fPIC -DPIC -o .libs/apc_stack.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=compile gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_zend.c -o apc_zend.lo
 gcc -pipe -I/usr/include/xmltok -I/usr/include/openssl -Wall -O2 -I. -I/home/xxxx/src/php-apc/APC-3.0.12p2 -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-apc/APC-3.0.12p2/apc_zend.c  -fPIC -DPIC -o .libs/apc_zend.o
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=link gcc -DPHP_ATOM_INC -I/home/xxxx/src/php-apc/APC-3.0.12p2/include -I/home/xxxx/src/php-apc/APC-3.0.12p2/main -I/home/xxxx/src/php-apc/APC-3.0.12p2 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -o apc.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/xxxx/src/php-apc/APC-3.0.12p2/modules  apc.lo php_apc.lo apc_cache.lo apc_compile.lo apc_debug.lo apc_fcntl.lo apc_main.lo apc_mmap.lo apc_optimizer.lo apc_pair.lo apc_sem.lo apc_shm.lo apc_sma.lo apc_stack.lo apc_zend.lo -lrt
gcc -shared  .libs/apc.o .libs/php_apc.o .libs/apc_cache.o .libs/apc_compile.o .libs/apc_debug.o .libs/apc_fcntl.o .libs/apc_main.o .libs/apc_mmap.o .libs/apc_optimizer.o .libs/apc_pair.o .libs/apc_sem.o .libs/apc_shm.o .libs/apc_sma.o .libs/apc_stack.o .libs/apc_zend.o  -lrt  -Wl,-soname -Wl,apc.so -o .libs/apc.so
creating apc.la
(cd .libs && rm -f apc.la && ln -s ../apc.la apc.la)
/bin/sh /home/xxxx/src/php-apc/APC-3.0.12p2/libtool --mode=install cp ./apc.la /home/xxxx/src/php-apc/APC-3.0.12p2/modules
cp ./.libs/apc.so /home/xxxx/src/php-apc/APC-3.0.12p2/modules/apc.so
cp ./.libs/apc.lai /home/xxxx/src/php-apc/APC-3.0.12p2/modules/apc.la
PATH="$PATH:/sbin" ldconfig -n /home/xxxx/src/php-apc/APC-3.0.12p2/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /home/xxxx/src/php-apc/APC-3.0.12p2/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.
(It is safe to ignore warnings about tempnam and tmpnam).

xxxx@prius:~/src/php-apc/APC-3.0.12p2$

コンパイル結果確認

apacheのモジュール(so)ができているか確認

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ ls -al ./modules/
合計 491
drwxr-xr-x  2 xxxx xxxx     96 2006-10-08 03:07 .
drwxr-xr-x  8 xxxx xxxx   2624 2006-10-08 03:07 ..
-rw-r--r--  1 xxxx xxxx    796 2006-10-08 03:07 apc.la
-rwxr-xr-x  1 xxxx xxxx 492255 2006-10-08 03:07 apc.so
xxxx@prius:~/src/php-apc/APC-3.0.12p2$

無事コンパイル完了した。

make install (apc.so 配置)

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ sudo make install
Password:
Installing shared extensions:     /usr/lib/php4/20020429/
xxxx@prius:~/src/php-apc/APC-3.0.12p2$
xxxx@prius:~/src/php-apc/APC-3.0.12p2$ ls -al /usr/lib/php4/20020429/
合計 645
drwxr-xr-x  2 root root    144 2006-10-08 03:11 .
drwxr-xr-x  6 root root    176 2006-10-08 01:45 ..
-rwxr-xr-x  1 root root 492255 2006-10-08 03:11 apc.so
-rw-r--r--  1 root root  33800 2005-08-25 12:27 curl.so
-rw-r--r--  1 root root  81884 2005-08-25 12:27 gd.so
-rw-r--r--  1 root root  44144 2005-08-25 12:27 mysql.so
xxxx@prius:~/src/php-apc/APC-3.0.12p2$

/usr/lib/php4/20020429/apc.so に配置されました。

# strip してないからサイズが異常に大きいけど。。

php.ini 追記

xxxx@prius:~/src/php-apc/APC-3.0.12p2$ sudo vi /etc/php4/apache2/php.ini
; Local Variables:
; tab-width: 4
; End:
extension=mysql.so
extension=gd.so
extension=curl.so

;;;add 2006/10/07
extension=apc.so
apc.enabled=1
apc.shm_segments=1
apc.optimization=0
apc.shm_size=30
apc.ttl=3600
apc.user_ttl=0
apc.num_files_hint=1000
apc.mmap_file_mask=/tmp/apc.XXXXXX
apc.enable_cli=1

動作確認

apcを無効/有効 のケースでテストしてみたが、
早くなっているのか分からない。

このような感じで
http://lerdorf.com/apc.php
apcの動作状況をweb上から閲覧できるツールがあるので、使わせてもらった。
http://lerdorf.com/apc.phps のソースをコピーして、Webからアクセスしてみたが
いくらphpスクリプトにアクセスしても、キャッシュされない。

ツールとapc本体のバージョンの不一致とかあるかもしれないけど。。

そもそも早くなっている効果を感じれないので、多分動いていないのかと。
消化不良だが、このあたりで断念する。

eaccelerator-0.9.5-rc1

参考

PHP:eAccelerator で PHP 高速化 - Y-110's Wiki:
http://php.y-110.net/wiki/index.php?PHP%A1%A7eAccelerator%20%A4%C7%20PHP%20%B9%E2%C2%AE%B2%BD

QINGLONG’S -モノ作り的思考- - PHPにアクセラレータを導入する:
http://d.hatena.ne.jp/qinglong/20051110/p1

QINGLONG’S -モノ作り的思考- - 結局、ベンチマークまで取ってしまった。。。:
http://d.hatena.ne.jp/qinglong/20051110

インストール

ソースダウンロード

xxxx@prius:~/src$ mkdir php-eaccelerator
xxxx@prius:~/src$ cd php-eaccelerator/
xxxx@prius:~/src/php-eaccelerator$ wget http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5-rc1.zip
--04:55:14--  http://jaist.dl.sourceforge.net/sourceforge/eaccelerator/eaccelerator-0.9.5-rc1.zip
           => `eaccelerator-0.9.5-rc1.zip'
jaist.dl.sourceforge.net をDNSに問いあわせています... 150.65.7.130
jaist.dl.sourceforge.net[150.65.7.130]:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 185,466 [application/zip]

100%[===============================================================================>] 185,466     1009.59K/s

04:55:14 (1008.28 KB/s) - `eaccelerator-0.9.5-rc1.zip' を保存しました [185466/185466]

xxxx@prius:~/src/php-eaccelerator$
xxxx@prius:~/src/php-eaccelerator$ ls -al
合計 184
drwxr-xr-x  2 xxxx xxxx     96 2006-10-08 04:55 .
drwxr-xr-x  9 xxxx xxxx    232 2006-10-08 04:54 ..
-rw-r--r--  1 xxxx xxxx 185466 2006-07-25 22:08 eaccelerator-0.9.5-rc1.zip
xxxx@prius:~/src/php-eaccelerator$

解凍

xxxx@prius:~/src/php-eaccelerator$ unzip eaccelerator-0.9.5-rc1.zip
Archive:  eaccelerator-0.9.5-rc1.zip
   creating: eaccelerator-0.9.5-rc1/
  inflating: eaccelerator-0.9.5-rc1/shm.c
  inflating: eaccelerator-0.9.5-rc1/x86_spinlocks.h
  inflating: eaccelerator-0.9.5-rc1/COPYING
  inflating: eaccelerator-0.9.5-rc1/ea_info.c
  inflating: eaccelerator-0.9.5-rc1/ea_restore.h
  inflating: eaccelerator-0.9.5-rc1/config.m4
  inflating: eaccelerator-0.9.5-rc1/debug.c
  inflating: eaccelerator-0.9.5-rc1/config.w32
  inflating: eaccelerator-0.9.5-rc1/mm.h
  inflating: eaccelerator-0.9.5-rc1/opcodes.c
  inflating: eaccelerator-0.9.5-rc1/session.h
   creating: eaccelerator-0.9.5-rc1/win32/
  inflating: eaccelerator-0.9.5-rc1/win32/eLoader.vcproj
  inflating: eaccelerator-0.9.5-rc1/win32/eAccelerator.dsw
  inflating: eaccelerator-0.9.5-rc1/win32/eAccelerator.sln
  inflating: eaccelerator-0.9.5-rc1/win32/eAccelerator.dsp
  inflating: eaccelerator-0.9.5-rc1/win32/eAccelerator.vcproj
  inflating: eaccelerator-0.9.5-rc1/win32/eLoader.dsp
  inflating: eaccelerator-0.9.5-rc1/ea_info.h
  inflating: eaccelerator-0.9.5-rc1/Makefile.in
  inflating: eaccelerator-0.9.5-rc1/ea_restore.c
   creating: eaccelerator-0.9.5-rc1/eLoader/
  inflating: eaccelerator-0.9.5-rc1/eLoader/config.m4
  inflating: eaccelerator-0.9.5-rc1/eLoader/Makefile.in
  inflating: eaccelerator-0.9.5-rc1/eLoader/autogen.sh
  inflating: eaccelerator-0.9.5-rc1/content.c
  inflating: eaccelerator-0.9.5-rc1/ea_dasm.h
   creating: eaccelerator-0.9.5-rc1/doc/
  inflating: eaccelerator-0.9.5-rc1/doc/phpdoc.ini
   creating: eaccelerator-0.9.5-rc1/doc/php/
  inflating: eaccelerator-0.9.5-rc1/doc/php/info.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/shared_memory.php
   creating: eaccelerator-0.9.5-rc1/doc/php/examples/
  inflating: eaccelerator-0.9.5-rc1/doc/php/examples/eaccelerator_cache_output.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/examples/eaccelerator_cache_result.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/examples/eaccelerator_cache_page.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/examples/eaccelerator_lock.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/session.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/dasm.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/encoder.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/loader.php
  inflating: eaccelerator-0.9.5-rc1/doc/php/cache.php
  inflating: eaccelerator-0.9.5-rc1/eaccelerator_version.h
  inflating: eaccelerator-0.9.5-rc1/optimize.c
  inflating: eaccelerator-0.9.5-rc1/README.win32
  inflating: eaccelerator-0.9.5-rc1/README
  inflating: eaccelerator-0.9.5-rc1/loader.c
  inflating: eaccelerator-0.9.5-rc1/ea_store.h
  inflating: eaccelerator-0.9.5-rc1/bugreport.php
  inflating: eaccelerator-0.9.5-rc1/cache.c
  inflating: eaccelerator-0.9.5-rc1/mm.c
  inflating: eaccelerator-0.9.5-rc1/PHP_Highlight.php
  inflating: eaccelerator-0.9.5-rc1/cache.h
  inflating: eaccelerator-0.9.5-rc1/control.php
  inflating: eaccelerator-0.9.5-rc1/session.c
  inflating: eaccelerator-0.9.5-rc1/opcodes.h
  inflating: eaccelerator-0.9.5-rc1/NEWS
  inflating: eaccelerator-0.9.5-rc1/debug.h
  inflating: eaccelerator-0.9.5-rc1/content.h
  inflating: eaccelerator-0.9.5-rc1/dasm.php
  inflating: eaccelerator-0.9.5-rc1/encoder.php
  inflating: eaccelerator-0.9.5-rc1/eaccelerator.h
  inflating: eaccelerator-0.9.5-rc1/shm.h
  inflating: eaccelerator-0.9.5-rc1/eaccelerator.c
  inflating: eaccelerator-0.9.5-rc1/AUTHORS
  inflating: eaccelerator-0.9.5-rc1/README.eLoader
  inflating: eaccelerator-0.9.5-rc1/ea_store.c
  inflating: eaccelerator-0.9.5-rc1/encoder.c
  inflating: eaccelerator-0.9.5-rc1/ea_dasm.c
  inflating: eaccelerator-0.9.5-rc1/ChangeLog
  inflating: eaccelerator-0.9.5-rc1/eaccelerator.ini
xxxx@prius:~/src/php-eaccelerator$

cat README

xxxx@prius:~/src/php-eaccelerator$ cd eaccelerator-0.9.5-rc1
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ cat README
eAccelerator for PHP
=====================

What is eAccelerator?
----------------------
eAccelerator is a free open source PHP  accelerator,  optimizer,  encoder  and
dynamic content cache for PHP. It increases  performance  of  PHP  scripts  by
caching them in compiled state, so that the overhead of  compiling  is  almost
completely eliminated. It also optimises  the  script  to speed  up  execution
of PHP scripts. eAccelerator typically reduces server load and  increases  the
speed of your PHP code by 1-10 times.

eAccelerator is a fork of TurckMMCache
( http://sourceforge.net/project/turckmm-cache/  by Dmitry Stogov )

eAccelerator stores compiled PHP scripts in shared memory  and  executes  code
directly from it. It creates  locks  only  for  short  time,  while  searching
compiled PHP script in the cache, so one script can be executed simultaneously
by several engines. Files that can't fit in shared memory are cached  on  disk
only.

eAccelerator contains a PHP encoder and loader. You  can  encode  PHP  scripts
using encoder.php in order to distribute them without sources.  Encoded  files
can be run on any site which  runs  PHP  with  eAccelerator.  The  sources  of
encoded scripts can't be restored because they are stored in a  compiled  form
and the encoded version doesn't contain the source. Of course, some  internals
of the scripts can  be  restored  with  different  reverse  engineering  tools
(disassemblers, debuggers, etc), but it is not trivial.

eAccelerator is compatible with Zend Optimizer's loader. Zend  Optimizer  must
be installed after eAccelerator in php.ini. If you don't use  scripts  encoded
with  Zend  Encoder  we  do  not  recommend  to  install  Zend  Optimizer with
eAccelerator.

eAccelerator does not work in CGI mode but it does work in Fast-CGI mode with
webservers like lighttpd.


Here are some other products that provide the same functionality:

 - Zend Performance Suite (http://www.zend.com/)
 - Alternative PHP Cache (http://pecl.php.net/package/APC)

Download
--------
Latest eAccelerator versions can be downloaded at the sourceforge page:
http://sourceforge.net/projects/eaccelerator/
Development snapshots from cvs can be downloaded at
http://snapshots.eaccelerator.net


Requirements
------------
apache >= 1.3, mod_php >= 4.1, autoconf, automake, libtool, m4


Compatibility
-------------
eAccelerator has been reported working with php4 and php5, php 5.1 support
hasn't been integrated yet. It is being used on Linux, FreeBSD, MacOS X,
Solaris and Windows with apache 1.3 and 2, lighttpd and IIS.


Quick install
-------------

You can find more information about installation on eAccelerator website.
http://eaccelerator.sourceforge.net/

Note(1): for Microsoft Windows installation, please refer to README.win32 file.

Step 1. Compiling eAccelerator

  export PHP_PREFIX="/usr"

  $PHP_PREFIX/bin/phpize

  ./configure \
  --enable-eaccelerator=shared \
  --with-php-config=$PHP_PREFIX/bin/php-config

  make

  You must specify the real prefix where PHP is installed in the "export"
  command. It may be "/usr" "/usr/local", or something else.

Step 2. Installing eAccelerator

  make install

Step 3. Configuring eAccelerator

eAccelerator can be installed both as Zend or PHP extension.

For eaccelerator > 0.9.1, if you have /etc/php.d directory, you should copy eaccelerator.ini inside and modify default value if you need.

If not, you need to edit your php.ini file (usually /etc/php.ini).

To install as Zend extension:

  zend_extension="/usr/lib/php4/eaccelerator.so"
  eaccelerator.shm_size="16"
  eaccelerator.cache_dir="/tmp/eaccelerator"
  eaccelerator.enable="1"
  eaccelerator.optimizer="1"
  eaccelerator.check_mtime="1"
  eaccelerator.debug="0"
  eaccelerator.filter=""
  eaccelerator.shm_max="0"
  eaccelerator.shm_ttl="0"
  eaccelerator.shm_prune_period="0"
  eaccelerator.shm_only="0"
  eaccelerator.compress="1"
  eaccelerator.compress_level="9"

  If you use thread safe build of PHP you must use "zend_extension_ts" instead
  of "zend_extension".

To install as PHP extension:

  extension="eaccelerator.so"
  eaccelerator.shm_size="16"
  eaccelerator.cache_dir="/tmp/eaccelerator"
  eaccelerator.enable="1"
  eaccelerator.optimizer="1"
  eaccelerator.check_mtime="1"
  eaccelerator.debug="0"
  eaccelerator.filter=""
  eaccelerator.shm_max="0"
  eaccelerator.shm_ttl="0"
  eaccelerator.shm_prune_period="0"
  eaccelerator.shm_only="0"
  eaccelerator.compress="1"
  eaccelerator.compress_level="9"

Step 4. Creating cache directory

  mkdir /tmp/eaccelerator
  chmod 0777 /tmp/eaccelerator


Configuration Options
---------------------

eaccelerator.shm_size
    The amount of shared memory (in megabytes) that eAccelerator will use.
    "0" means OS default. Default value is "0".

eaccelerator.cache_dir
    The directory that is used for disk cache. eAccelerator stores precompiled
    code, session data, content and user entries  here. The same data  can  be
    stored in shared memory also (for more quick access). Default value is
    "/tmp/eaccelerator".

eaccelerator.enable
    Enables or disables eAccelerator. Should be "1" for enabling  or  "0"  for
    disabling. Default value is "1".

eaccelerator.optimizer
    Enables or disables internal peephole optimizer which may  speed  up  code
    execution. Should be "1" for enabling or "0" for disabling. Default  value
    is "1".

eaccelerator.debug
    Enables or disables debug logging. Should be "1" for enabling or  "0"  for
    disabling. Default value is "0".

eaccelerator.check_mtime
    Enables or disables PHP file modification checking .  Should  be  "1"  for
    enabling or "0" for disabling. You should set it to "1"  if  you  want  to
    recompile PHP files after modification. Default value is "1".

eaccelerator.filter
    Determine which PHP files must be cached. You may specify  the  number  of
    patterns (for example "*.php *.phtml") which specifies to cache or not  to
    cache. If pattern starts with the character "!", it means to ignore  files
    which are matched by the following pattern. Default value is "" that means
    all PHP scripts will be cached.

eaccelerator.shm_max
    Disables putting large values into shared memory by " eaccelerator_put() "
    function. It indicates the largest allowed size in bytes (10240, 10K, 1M).
    The "0" disables the limit. Default value is "0".

eaccelerator.shm_ttl
    When eaccelerator fails to get shared memory for new script it removes all
    scripts which were not accessed  at  last "shm_ttl"  seconds  from  shared
    memory. Default value is "0" that means -  don't  remove  any  files  from
    shared memory.

eaccelerator.shm_prune_period
    When eaccelerator fails to get shared memory for new script  it  tryes  to
    remove  old  script   if   the   previous   try   was   made   more   then
    "shm_prune_period" seconds ago. Default value is "0" that  means  -  don't
    try to remove any files from shared memory.

eaccelerator.shm_only
    Enables or disables caching of compiled scripts on disk. It has  no  effect
    on session data and content caching. Default value is "0" that means -  use
    disk and shared memory for caching.

eaccelerator.compress
    Enables or disables cached content compression. Default value is  "1"  that
    means enable compression.

eaccelerator.compress_level
    Compression level used for content caching.  Default value is "9" which  is
    the maximum value

eaccelerator.name_space
    A string that's prepended to all keys. This allows two applications that
    use the same key names to run on the same host by setting this in .htaccess
    or in the main configuration file for the whole webserver.

eaccelerator.keys
eaccelerator.sessions
eaccelerator.content
    Determine where keys, session data and content will be cached. The possible
    values are:
    "shm_and_disk" - cache data in shared memory and on disk (default value)
    "shm"          - cache data in shared memory or on disk if shared memory
                     is full or data size greater then "eaccelerator.shm_max"
    "shm_only"     - cache data in shared memory
    "disk_only"    - cache data on disk
    "none"         - don't cache data

eaccelerator.allowed_admin_path
    The script paths that are allowed to get admin information and do admin
    controls

Control panel and disassembler
------------------------------

If you want to use the control-panel you need to compile eAccelerator with
    --with-eaccelerator-info which is the default value.
You need to copy the control.php file to your webroot and set the path to it
in the php.ini or eaccelerator.ini in the eaccelerator.allowed_admin_path
directive. If you don't do this you wont be able to see much information and
can't control eAccelerator.
You can set the username and password needed to access the control-panel in
the control.php file.

When you compile eAccelerator with --with-eaccelerator-disassembler you need
to place the dasm.php and PHP_Highlight.php file also in the same directory
as the control.php file. The disassembler requires PHP to be compiled with
tokenizer support (--enable-tokenizer).
You can set the username and password needed to access the disassembler at the
top of dasm.php.

eAccelerator API
----------------

API documentation can be found on this website: http://bart.eaccelerator.net/doc/phpdoc/

Contact us
----------
You can contact us with questions, patches or bugs, by sending an email to
Bart Vanbrabant <zoeloelip at users.sourceforge.net>

export PHP_PREFIX

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ export PHP_PREFIX="/usr"

phpize

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ $PHP_PREFIX/bin/phpize
Configuring for:
PHP Api Version:         20020918
Zend Module Api No:      20020429
Zend Extension Api No:   20021010
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$

./configure

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ ./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking whether gcc and cc understand -c and -o together... yes
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM
checking for PHP extension directory... /usr/lib/php4/20020429
checking for re2c... exit 0;
checking for gawk... no
checking for mawk... mawk
checking whether to enable eaccelerator support... yes, shared
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking mandatory system headers... yes
checking whether union semun is defined in sys/sem.h... no
checking for sysvipc shared memory support... no
checking for mmap shared memory support... yes
checking for mmap on /dev/zero shared memory support... yes
checking for anonymous mmap shared memory support... yes
checking for posix mmap shared memory support... no
checking for best shared memory type... anonymous mmap
checking for spinlock semaphores support... yes
checking for pthread semaphores support... no
checking for posix semaphores support... no
checking for sysvipc semaphores support... yes
checking for fcntl semaphores support... yes
checking for flock semaphores support... yes
checking for best semaphores type... spinlock
checking for sched_yield... yes
checking for mprotect... yes
checking for ext/session/php_session.h... yes
checking for a sed that does not truncate output... /bin/sed
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether  accepts -g... no
checking the maximum length of command line arguments... 32768
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag  works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC
checking if gcc PIC flag -fPIC works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
configure: creating ./config.status
config.status: creating config.h
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$

make

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ make
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/eaccelerator.c -o eaccelerator.lo
mkdir .libs
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/eaccelerator.c  -fPIC -DPIC -o .libs/eaccelerator.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/optimize.c -o optimize.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/optimize.c  -fPIC -DPIC -o .libs/optimize.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/encoder.c -o encoder.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/encoder.c  -fPIC -DPIC -o .libs/encoder.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/loader.c -o loader.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/loader.c  -fPIC -DPIC -o .libs/loader.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/opcodes.c -o opcodes.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/opcodes.c  -fPIC -DPIC -o .libs/opcodes.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/content.c -o content.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/content.c  -fPIC -DPIC -o .libs/content.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/mm.c -o mm.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/mm.c  -fPIC -DPIC -o .libs/mm.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/session.c -o session.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/session.c  -fPIC -DPIC -o .libs/session.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/shm.c -o shm.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/shm.c  -fPIC -DPIC -o .libs/shm.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/debug.c -o debug.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/debug.c  -fPIC -DPIC -o .libs/debug.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/cache.c -o cache.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/cache.c  -fPIC -DPIC -o .libs/cache.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/ea_restore.c -o ea_restore.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/ea_restore.c  -fPIC -DPIC -o .libs/ea_restore.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/ea_store.c -o ea_store.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/ea_store.c  -fPIC -DPIC -o .libs/ea_store.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/ea_info.c -o ea_info.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/ea_info.c  -fPIC -DPIC -o .libs/ea_info.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=compile gcc  -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/ea_dasm.c -o ea_dasm.lo
 gcc -I. -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H -g -O2 -c /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/ea_dasm.c  -fPIC -DPIC -o .libs/ea_dasm.o
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=link gcc -DPHP_ATOM_INC -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/include -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/main -I/home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1 -I/usr/include/php4 -I/usr/include/php4/main -I/usr/include/php4/Zend -I/usr/include/php4/TSRM  -I/usr/include/apr-0 -I/usr/include/apache2 -DAPC_PHP4_STAT -DHAVE_CONFIG_H  -g -O2   -o eaccelerator.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/modules  eaccelerator.lo optimize.lo encoder.lo loader.lo opcodes.lo content.lo mm.lo session.lo shm.lo debug.lo cache.lo ea_restore.lo ea_store.lo ea_info.lo ea_dasm.lo
gcc -shared  .libs/eaccelerator.o .libs/optimize.o .libs/encoder.o .libs/loader.o .libs/opcodes.o .libs/content.o .libs/mm.o .libs/session.o .libs/shm.o .libs/debug.o .libs/cache.o .libs/ea_restore.o .libs/ea_store.o .libs/ea_info.o .libs/ea_dasm.o   -Wl,-soname -Wl,eaccelerator.so -o .libs/eaccelerator.so
creating eaccelerator.la
(cd .libs && rm -f eaccelerator.la && ln -s ../eaccelerator.la eaccelerator.la)
/bin/sh /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/libtool --mode=install cp ./eaccelerator.la /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/modules
cp ./.libs/eaccelerator.so /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/modules/eaccelerator.so
cp ./.libs/eaccelerator.lai /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/modules/eaccelerator.la
PATH="$PATH:/sbin" ldconfig -n /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /home/xxxx/src/php-eaccelerator/eaccelerator-0.9.5-rc1/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.
(It is safe to ignore warnings about tempnam and tmpnam).

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$

make install

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ sudo make install
:

eaccelerator.so の確認

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ ls -al /usr/lib/php4/20020429/
合計 1325
drwxr-xr-x  2 root root    208 2006-10-08 05:01 .
drwxr-xr-x  6 root root    176 2006-10-08 01:45 ..
-rw-r--r--  1 root root  70996 2006-10-08 04:38 apc.so
-rwxr-xr-x  1 root root 492255 2006-10-08 04:37 apc.so.org
-rw-r--r--  1 root root  33800 2005-08-25 12:27 curl.so
-rwxr-xr-x  1 root root 619822 2006-10-08 05:01 eaccelerator.so
-rw-r--r--  1 root root  81884 2005-08-25 12:27 gd.so
-rw-r--r--  1 root root  44144 2005-08-25 12:27 mysql.so
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$

設定

/tmp/eaccelerator

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ sudo mkdir /tmp/eaccelerator
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ sudo chmod 0777 /tmp/eaccelerator
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$

php.ini修正

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ sudo vi /etc/php4/apache2/php.ini
;;;add 2006/10/07
extension="eaccelerator.so"
eaccelerator.shm_size="16"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"
;eaccelerator.log_file = "/var/log/apache2/eaccelerator_log"

ツール配置

ツールっぽいphpスクリプトがあったので、コピーしておく。

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ sudo mkdir /var/www/local/eaccelerator
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ sudo cp *.php /var/www/local/eaccelerator
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$

動作確認

/etc/init.d/apache2 restart

xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$ sudo /etc/init.d/apache2 restart
Forcing reload of web server: Apache2.
xxxx@prius:~/src/php-eaccelerator/eaccelerator-0.9.5-rc1$

phpinfo で確認

eAccelerator が表示されればおっけー

control.php で確認

Webからアクセス
http://xxxx.dip.jp/local/eaccelerator/control.php

ID/パスワードは、ソースコードに書かれているが、
デフォルトでは、admin/eaccelerator

Web画面の「Information」は正常に表示されているようだが、
それ以外の項目はデータが表示されないし、ボタンを押しても
反応がない。

とりあえず、PHPスクリプトの実行速度は速くなったので
よしとする。

最終更新時間:2006年10月17日 16時40分24秒