[英]How To Install APC Via Pecl
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. 我必须通过cmd安装apc。
problem im facing is installation failure. 面临的问题是安装失败。
尝试使用默认的系统apc install:
sudo apt-get install php-apc
Here is how I install PHP APC: 以下是我安装PHP APC的方法:
Download latest stable Version 下载最新的稳定版本
PHP APC-3.1.9 (stable) can be found on PECL page . PHP APC-3.1.9(稳定版)可以在PECL 页面上找到。 Download and save (to desktop).
下载并保存(到桌面)。
Begin installation 开始安装
Untar APC, move into extracted directory Untar APC,进入解压缩目录
tar xvzf APC-3.1.9.tgz
cd APC-3.1.9/
Now, we want to phpize current directory. 现在,我们想要phpize当前目录。 Because I use LAMPP PHP installation, its
phpize
is located in /opt/lampp/bin
. 因为我使用LAMPP PHP安装,它的
phpize
位于/opt/lampp/bin
。 Then, new .configure
file will be created (your php-config
may differ). 然后,将创建新的
.configure
文件(您的php-config
可能不同)。
/opt/lampp/bin/phpize
./configure --with-php-config=/opt/lampp/bin/php-config
Then, 然后,
make
sudo make install
Configure php.ini file 配置php.ini文件
Next, we want to configure APC for use. 接下来,我们要配置APC以供使用。 Edit your php.ini file.
编辑你的php.ini文件。 (mine was located in
/opt/lampp/etc/php.ini
). (我的位于
/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 还可以在php.ini文件上编辑
extension_dir
extension_dir = "/opt/lampp/lib/php/extensions/no-debug-non-zts-20100525/"
your extension_dir
refers to make install
result. 你的
extension_dir
指的是make install
结果。
Now, look at phpinfo()
page to verify your APC installation. 现在,查看
phpinfo()
页面以验证您的APC安装。
References: 参考文献:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.