我正在尝试加载php_opcache以加速我的应用程序,但似乎无法让它显示在我的wampserver上的phpinfo中。我在apache httpd.conf中加载了mod_fcgi,并在PHP设置下加载了dll php_opcache,如下所示。
我尝试了
的建议 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)
self.blurLoading.showsFPS = true
self.blurLoading.showsNodeCount = true
let s:MyScene = MyScene (size: self.blurLoading.bounds.size)
s.scaleMode = SKSceneScaleMode.AspectFill
self.blurLoading.presentScene (s)
php_opcache.dll
wampserver php ext文件夹中显示的php_opcache.dll
C:\瓦帕\ BIN \ PHP中\ php5.5.12 \ php.ini中
LoadModule fcgid_module modules/mod_fcgid.so
(php_opache带有感叹号)
答案 0 :(得分:0)
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目录和zend_ext目录中都安装了php_opcache.dll并重新启动了wampserver。
5)最后,在运行我的phpinfo()脚本时,我终于看到列出了Zend PHP OpCache。
在页面的开头,我也确认了正在显示的消息。
该程序使用Zend脚本语言引擎:Zend 引擎v2.5.0,版权所有(c)1998-2014 Zend Technologies Zend Technologies的Zend OPcache v7.0.4-dev,Copyright(c)1999-2014,