PHP:已启用APC,但仍然无法正常工作? [英] PHP: APC enabled, but still doesn't work?

查看:145
本文介绍了PHP:已启用APC,但仍然无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在新的Xubuntubox上,我安装了lamp-server工具phpphp-apc,并在php.ini中添加了extension=apc.so行,并重新引导了系统. Apache和PHP似乎运行良好,但是APC却不能.

On my new Xubuntubox I installed the lamp-server tools, php, php-apc, added the extension=apc.so line to the php.ini and rebootet the system. Apache and PHP seem to work well, but APC doesn't.

所以我检查了apc.php文件的内容:

So I checked what the apc.php file would say:

No cache info available. APC does not appear to be running.

但是在php信息中,它似乎已启用.看看php -i | grep 'apc'怎么说:

But in the php info it seems to be enabled. Have a look what php -i | grep 'apc' says:

Additional .ini files parsed => /etc/php5/cli/conf.d/apc.ini,
apc
apc.cache_by_default => On => On
apc.canonicalize => On => On
apc.coredump_unmap => Off => Off
apc.enable_cli => Off => Off
apc.enabled => On => On             <- it is enabled
apc.file_md5 => Off => Off
apc.file_update_protection => 2 => 2
apc.filters => no value => no value
apc.gc_ttl => 3600 => 3600
apc.include_once_override => Off => Off
apc.lazy_classes => Off => Off
apc.lazy_functions => Off => Off
apc.max_file_size => 1M => 1M
apc.mmap_file_mask => no value => no value
apc.num_files_hint => 1000 => 1000
apc.preload_path => no value => no value
apc.report_autofilter => Off => Off
apc.rfc1867 => Off => Off
apc.rfc1867_freq => 0 => 0
apc.rfc1867_name => APC_UPLOAD_PROGRESS => APC_UPLOAD_PROGRESS
apc.rfc1867_prefix => upload_ => upload_
apc.rfc1867_ttl => 3600 => 3600
apc.serializer => default => default
apc.shm_segments => 1 => 1
apc.shm_size => 32M => 32M
apc.slam_defense => On => On
apc.stat => On => On
apc.stat_ctime => Off => Off
apc.ttl => 0 => 0
apc.use_request_time => On => On
apc.user_entries_hint => 4096 => 4096
apc.user_ttl => 0 => 0
apc.write_lock => On => On

按预期php -m | grep 'apc'也会找到apc.

您知道缺少什么吗,我无法正确使用它?

Do you know what is missing, that I can't use it correctly?

推荐答案

有两种方法来运行PHP.

There are two ways to run PHP.

您正在显示PHP的CLI配置,而apc.php未使用它.

You are showing the CLI configuration for PHP, and apc.php is not using it.

实际上,如果通过浏览器检查phpinfo(),则可以看到未加载APC扩展名.

Indeed, if you check phpinfo() through your browser, you can see that no APC extension is loaded.

解决方案:/etc/php5/cgi/conf.d/apc.ini(cgi而不是cli)打开,然后再次将您的配置粘贴到该位置.重新启动Web服务器(sudo service httpd restart)并瞧瞧!

The solution : Open at /etc/php5/cgi/conf.d/apc.ini (cgi not cli) and paste your configuration there, again. Restart the web server (sudo service httpd restart) and voilà !

希望这会有所帮助!

这篇关于PHP:已启用APC,但仍然无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆