The 5th Annual China PHP Conference


To rozszerzenie » PECL nie jest dołączane do PHP.

Informacje na temat instalacji tego rozszerzenia PECL można znaleźć w podręczniku w rozdziale zatytułowanym Instalacja rozszerzeń PECL. Dodatkowe informacje, takie jak nowe wersje, pliki do pobrania, pliki źródłowe, informacje o opiekunach czy rejestr zmian, można znaleźć tutaj: »

DLL z tym rozszerzeniem PECL można pobrać zarówno ze strony » PHP Downloads lub z »

Informacja: On Windows, APC needs a temp path to exist, and be writable by the web server. It checks the TMP, TEMP and USERPROFILE environment variables in that order and finally tries the WINDOWS directory if none of those are set.

Informacja: For more in-depth, highly technical implementation details, see the »  developer-supplied TECHNOTES file .

add a note add a note

User Contributed Notes 12 notes

61924 dot 00 at gmail dot com
8 years ago
sudo apt-get install php-apc
sudo /etc/init.d/apache2 restart

Was enough for me. I use Ubuntu Server 8.10.
flydian80 at yahoo dot com
5 years ago
Install successfully on RHEL5 with user-defined path. In case someone needs it, I put the steps here.

I am not the su user and don't have its right too. Basically I installed the Apache and PHP 5.3.10 on the folder under my user directory.
My user directoy like /home/dxxx, php is at /home/dxxx/php, apache is at /home/dxxx/php.

1: I get APC-3.1.9.tar.gz from PECL and put in at /home/dxxx/php/etc.
2: /home/dxxx/php/etc: tar -xvfz APC-3.1.9.tar.gz
3: We get a folder named APC-3.1.9, then cd APC-3.1.9
4: /home/dxxx/php/etc/APC-3.1.9: /home/dxxx/php/bin/./phpize ( because I installed php on user-defined foler, need to go there to find the "phpize")
It shows:
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

5: /home/dxxx/php/etc/APC-3.1.9: ./config --with-php-config=/home/dxxx/php/bin/php-config --enable-apc --enable-apc-debug ( Because I am asked to put --with-php-config=PATH, if I don't provide it)

--Ignore the output message

6: /home/dxxx/php/etc/APC-3.1.9: make
We should be able to see a "" file under modules/.

7:  /home/dxxx/php/etc/APC-3.1.9: make install
This step copies that "" file to your extension folder. We can do it manually either.

8: Add to you php.ini, then restart the apache server

9: /home/dxxx/php/etc/APC-3.1.9: /home/dxxx/php/bin/./php -m
We should be able to see the "apc" on the list
scarywound at gmail com
5 years ago
Pay attention to the fact that installing php-apc package gives you APC version 3.1.3p1, which is according to UNSTABLE. If you want the latest STABLE edition (3.1.9 by now), you should use 'sudo pecl install apc' instead.
toby at telegraphics dot com dot au
8 years ago
On Gentoo,

# emerge pecl-apc

Check installation:

$ php -r 'phpinfo();' |grep apc
additional .ini files parsed => /etc/php/cli-php5/ext-active/apc.ini,
apc.cache_by_default => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => Off => Off
apc.enabled => On => On
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.max_file_size => 1M => 1M
apc.num_files_hint => 1024 => 1024
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_prefix => upload_ => upload_
apc.shm_segments => 1 => 1
apc.shm_size => 30 => 30
apc.slam_defense => 0 => 0
apc.stat => On => On
apc.stat_ctime => Off => Off
apc.ttl => 7200 => 7200
apc.user_entries_hint => 4096 => 4096
apc.user_ttl => 7200 => 7200
apc.write_lock => On => On
suhosin.apc_bug_workaround => Off => Off
JoeB at modernizedmedia dot com
1 year ago
After spending a few hours investigating this I have come to learn that as of php 5.5, there is an opcode cache built into php that you should use instead of wrestling with trying to install this one.  Especially on WAMP.
nhhecker+php_net at gmail dot com
3 years ago
The below steps should work on Red Hat Enterprise Linux (RHEL) 6.x / CentOS 6.x. By way of introduction I had a bit of trouble installing php-devel but finally found an RPM on that wold work with my version of php...
  # yum install gcc automake php httpd httpd-devel
  # yum list installed | grep php
  # rpm -Uvh

With that out ofthe way, I could continue the installation of APC...
  # yum install php-pear
  # pecl install apc
  # echo "" >> /etc/php.ini
  # echo "apc.enabled=1" >> /etc/php.ini
  # cp /usr/share/pear/apc.php /var/www/html/apc.php (this step is optional)
  # /etc/init.d/httpd restart

Finally, test opening the apc.php file in a Web browser if you opted to copy the file. If all goes well, you may want to delete the apc.php file when you're done.

5 years ago
On my Debian Squeeze 64-bit I also had to install the package "apache2-threaded-dev" with this command "apt-get install apache2-threaded-dev". Afterwards I did "pecl install apc" and everything seemed to work fine.
brian at diamondsea dot com
5 years ago
When installing on Plesk and cPanel machines, I get the following error message:

[root@web1 ~]# pecl install apc
downloading APC-3.1.9.tgz ...
Starting to download APC-3.1.9.tgz (155,540 bytes)
.................................done: 155,540 bytes
54 source files, building
running: phpize
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20060613
Zend Extension Api No:   220060519
/usr/bin/phpize: /tmp/pear/temp/APC/build/shtool: /bin/sh: bad interpreter: Permission denied
Cannot find autoconf. Please check your autoconf installation and the
$PHP_AUTOCONF environment variable. Then, rerun this script.

ERROR: `phpize' failed

The problem is caused by the /tmp/ filesystem being mounted noexec, which keeps any programs on /tmp/ from being allowed to be executed, which breaks the install script. 

To remount /tmp/ as executable, use:

[root@web1 ~]# mount -o remount,exec,suid /tmp

The it should install correctly.

After the install is done, remount the /tmp/ filesystem with the noexec permissions reset.

[root@web1 ~]# mount -o remount,noexec,nosuid /tmp
adonis at aynacorp dot com
4 years ago
Installation Steps For on Centos 6.3 / PHP 5.3.3

#use pecl to install it (you will be prompted during installation, I used the default values)
pecl install apc

# you should see something like this
downloading APC-3.1.9.tgz ...
Starting to download APC-3.1.9.tgz (155,540 bytes)
54 source files, building
running: phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Build process completed successfully
Installing '/usr/lib64/php/modules/'
Installing '/usr/include/php/ext/apc/apc_serializer.h'
install ok: channel://

#Great now that it is built,
#enable apc in php.ini
nano /etc/php.ini

# somewhere in you php.ini file add please not that path may be different for you installation

# copy the shipped apc.php to see what is going on wit apc on your server
cp /usr/share/pear/apc.php /root_dir_of_your_web_app

# now you should be able to see stats of APC running
8 years ago
debian etch installation

apt-get install apache2
apt-get install libapache2-mod-php5
apt-get install php-pear
apt-get install php5-dev
apt-get install make
apt-get install apache2-prefork-dev
pecl install apc

apache2-prefork-dev is necessary for not having the
"Sorry, I was not able to successfully run APXS."
pr at outwit dot com
7 years ago
Installed successfully on different FreeBSD servers, with mmap and IPC semaphores, but I got an error on a 64 bits box :

apc_sem_create: semctl(65536,...) failed: Result too large

I had to increase maximum semaphore value :

# sysctl kern.ipc.semvmx=131068
kern.ipc.semvmx: 32767 -> 131068
# echo "kern.ipc.semvmx=131068" >>  /etc/sysctl.conf

Works like a charm.
8 years ago
On Ubuntu I had to install the apache2-threaded-dev package.  It's the the Etch repos.
To Top