[英]wampserver - opcache not showing up in phpinfo()
我正在尝试加载php_opcache来加速我的应用程序,但似乎无法使其显示在我的wampserver上的phpinfo中。 我已经在Apache httpd.conf和dll php_opcache中加载了mod_fcgi,如下所示在PHP设置下。
我尝试了来自的建议
1) https://commaster.net/content/installing-php-fastcgi-and-zend-opcache-wampserver
2) http://forum.wampserver.com/read.php?2,130577,130577
无论我尝试什么,当我停止并重新启动wampserver时,我只会在服务器上看到带有红色感叹号的opcache。
我在下面包括了我的设置。
我该如何解决这个问题?
Apache LoadModule指令(C:\\ wamp \\ bin \\ apache \\ apache2.4.9 \\ conf)
LoadModule fcgid_module modules/mod_fcgid.so
php_opcache.dll
wampserver php ext文件夹中显示的php_opcache.dll
c:\\ wamp \\ bin \\ php \\ php5.5.12 \\ php.ini
zend_extension = php_opcache.dll
[opcache]
opcache.enable = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.revalidate_freq = 60
(php_opache带有感叹号)
1)确保两行都出现在httpd.conf中之后
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule fcgid_module modules/mod_fcgid.so
2)我继续将以下几行添加到httpd.conf
<IfModule fcgid_module>
FcgidInitialEnv PATH "C:/wamp/bin/php/php5.5.12;C:/WINDOWS/system32"
FcgidInitialEnv SystemRoot "C:/Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:/Wamp/tmp"
FcgidInitialEnv TMP "C:/Wamp/tmp"
FcgidInitialEnv windir "C:/WINDOWS"
FcgidIOTimeout 64
FcgidConnectTimeout 16
FcgidMaxRequestsPerProcess 1000
FcgidMaxProcesses 3
FcgidMaxRequestLen 8131072
# Location php.ini:
FcgidInitialEnv PHPRC "C:/wamp/bin/php/php5.5.12"
FcgidInitialEnv PHP_FCGI_MAX_REQUESTS 1000
<Files ~ "\.php$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "C:/wamp/bin/php/php5.5.12/php-cgi.exe" .php
</Files>
</IfModule>
3)然后将以下内容添加到php.ini中
zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
;
[xdebug]
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9000
zend_extension = "c:/wamp/bin/php/php5.5.12/ext/php_opcache.dll"
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=64
; The amount of memory for interned strings in Mbytes.
opcache.interned_strings_buffer=4
; The maximum number of keys (scripts) in the OPcache hash table.
; Only numbers between 200 and 100000 are allowed.
opcache.max_accelerated_files=2000
; The maximum percentage of "wasted" memory until a restart is scheduled.
opcache.max_wasted_percentage=5
; When this directive is enabled, the OPcache appends the current working
; directory to the script key, thus eliminating possible collisions between
; files with the same name (basename). Disabling the directive improves
; performance, but may break existing applications.
opcache.use_cwd=1
4)最后,我确保ext dir和zend_ext dir中都具有php_opcache.dll,并重新启动了wampserver。
5)最后,在运行phpinfo()脚本时,我终于看到列出了Zend PHP OpCache。
在页面的开头,我还确认了正在显示的消息。
该程序利用Zend脚本语言引擎:Zend Engine v2.5.0,版权所有(c)1998-2014,Zend Technologies with Zend OPcache v7.0.4-dev,版权所有(c)1999-2014,由Zend Technologies提供
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.