简体   繁体   English

我在php.ini中具有以下设置,但它们未在phpinfo中显示

[英]I have the following settings in php.ini but they aren't showing up in phpinfo

I have apcu enabled - version 4.0.11 Apache version: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips PHP/5.6.31 我已启用apcu-版本4.0.11 Apache版本:Apache / 2.4.6(Red Hat Enterprise Linux)OpenSSL / 1.0.2k-fips PHP / 5.6.31

This is at the end of php.ini 这是php.ini的结尾

apc.cache_by_default=On
apc.file_update_protection=2
apc.filters=
apc.max_file_size=1M
apc.num_files_hint=5024
apc.stat=1
apc.write_lock=On

I have also tried to put it in /etc/php.d/40-apcu.ini, but it had no effect. 我也尝试将其放在/etc/php.d/40-apcu.ini中,但是没有效果。

I restarted apache after changing the files. 更改文件后,我重新启动了Apache。

The reason I am trying to enable these variables is because we are upgrading to another server and these were the values on the old server. 我尝试启用这些变量的原因是因为我们正在升级到另一台服务器,而这些是旧服务器上的值。 If they are no longer needed or supported that is fine, but I could not find any documentation saying that. 如果不再需要或不支持它们,那很好,但是我找不到任何文档说明。

EDIT: Relevant PHP info 编辑:相关的PHP信息 INI APC

Edit: After updates, and further review. 编辑:更新后,进一步检查。 Zend OpCache Zend OpCache

PHP > 5.5 doesn't included APC, hense the "APC Support Emulated" in your phpinfo. PHP> 5.5不包含APC,请在您的phpinfo中添加“模拟的APC支持”。 Instead, it has Zend OpCache replaces APC Opcache. 相反,它用Zend OpCache替代了APC Opcache。 APC had two parts. APC有两个部分。 There does remain an APCu component of APC, for storing data, but all the settings you describe are specific to APC Opcache. APC的APCu组件仍然保留,用于存储数据,但是您描述的所有设置都是特定于APC Opcache的。

See: http://php.net/manual/en/opcache.configuration.php 请参阅: http//php.net/manual/en/opcache.configuration.php

You've got some troubleshooting to do 您需要进行一些故障排除

  1. As you have a php.d/40-apcu.ini , it is possible that one of those is over-riding the values in php.ini 当您拥有php.d/40-apcu.ini ,其中之一可能会覆盖php.ini中的值

  2. There may be some additional specific directives in the OS, or in Apache, to force some of those settings. 操作系统或Apache中可能还有一些其他的特定指令,以强制其中的某些设置。 If you didn't find an over-ride in the included ini files, you'll have to start a deep dive on apache config, and how it is started. 如果您没有在随附的ini文件中找到替代,则必须对apache config及其启动方式进行深入研究。

  3. Don't forget that apache config directives like Directory and VirtualHost , as well as .htaccess , can be allowed to change these settings. 不要忘记,可以使用DirectoryVirtualHost等Apache配置指令以及.htaccess来更改这些设置。

  4. Last but not least, in many configurations, php code itself can set these directives with the ini_set() function. 最后但并非最不重要的一点是,在许多配置中,php代码本身可以使用ini_set()函数设置这些指令。

Good Luck 祝好运

I had the same issue, it was caused by entering the wrong phpinfo url. 我有同样的问题,这是由输入错误的phpinfo网址引起的。

Wrong url: 网址错误:

http://localhost/?phpinfo=1

Correct url (note the -1 parameter) 正确的网址 (注意-1参数)

http://localhost/?phpinfo=-1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM