0

Description

I am trying to load php_opcache to accelerate my applications but can not seem to get it to show up in phpinfo on my wampserver. I have loaded mod_fcgi in apache httpd.conf and also the dll php_opcache as shown below under PHP Settings.

I tried the suggestions from

1) https://commaster.net/content/installing-php-fastcgi-and-zend-opcache-wampserver
2) http://forum.wampserver.com/read.php?2,130577,130577

No matter what I try I only see opcache with a red exclamation mark on my server when I stop and restart wampserver.

I have included my settings below.

How do I resolve this problem?

Apache Settings

Apache LoadModule Directive (C:\wamp\bin\apache\apache2.4.9\conf)

LoadModule fcgid_module modules/mod_fcgid.so

Apache Modules

PHP Settings

php_opcache.dll

php_opcache.dll shown in wampserver php ext folder

PHP_opcache

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

wampserver loaded modules

(php_opache is shown with an exclamation mark)

wampserver extensions

Vahe
  • 1,699
  • 3
  • 25
  • 76

1 Answers1

0

1) After making sure that both lines are present in httpd.conf

LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
LoadModule fcgid_module modules/mod_fcgid.so

2) I proceeded to add the following lines to 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) I then added the following to 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) Finally, I made sure to have php_opcache.dll in both ext dir and zend_ext dir and restarted wampserver.

5) Finally, When running my phpinfo() script I finally saw the Zend PHP OpCache listed.

At the beginning of the page I also confirmed the message being shown.

This program makes use of the Zend Scripting Language Engine: Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

Vahe
  • 1,699
  • 3
  • 25
  • 76