here is the output im getting.
showing output after running this command : pecl install apc downloading APC-3.1.13.tgz ... Starting to download APC-3.1.13.tgz (171,591 bytes) .....................................done: 171,591 bytes could not extract the package.xml file from "/build/buildd/php5-5.5.9+dfsg/pear- build-download/APC-3.1.13.tgz" Download of "pecl/apc" succeeded, but it is not a valid package archive Error: cannot download "pecl/APC" Download failed install failed.
I have to install apc via cmd.
problem im facing is installation failure.
尝试使用默认的系统apc install:
sudo apt-get install php-apc
Here is how I install PHP APC:
Download latest stable Version
PHP APC-3.1.9 (stable) can be found on PECL page . Download and save (to desktop).
Begin installation
Untar APC, move into extracted directory
tar xvzf APC-3.1.9.tgz
cd APC-3.1.9/
Now, we want to phpize current directory. Because I use LAMPP PHP installation, its phpize
is located in /opt/lampp/bin
. Then, new .configure
file will be created (your php-config
may differ).
/opt/lampp/bin/phpize
./configure --with-php-config=/opt/lampp/bin/php-config
Then,
make
sudo make install
Configure php.ini file
Next, we want to configure APC for use. Edit your php.ini file. (mine was located in /opt/lampp/etc/php.ini
).
vim /opt/lampp/etc/php.ini
Add these lines (preferably under Dynamic Extension section, but you can place it anywhere):
extension=apc.so
apc.enabled=1
apc.shm_size=40M
apc.ttl=7200
apc.user_ttl=7200
apc.enable_cli=1
apc.max_file_size=5M
also edit extension_dir
on php.ini file
extension_dir = "/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/"
your extension_dir
refers to make install
result.
Now, look at phpinfo()
page to verify your APC installation.
References:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.