Enable opcache for php in wamp

前端 未结 2 1552
礼貌的吻别
礼貌的吻别 2020-12-30 08:44

I try to enable opcache on wamp but it doesnt work. I changed the settings like this :

[opcache]
zend_extension=C:/wamp/bin/php/php5.5.12/ext/php_opcache.dl         


        
相关标签:
2条回答
  • Since you are working on windows i think you should set the path like this

    zend_extension=C:\path\to\php_opcache.dll (win) [Note the slash]

    for your case: zend_extension=C:\wamp\bin\php\php5.5.12\ext\php_opcache.dll

    Note that when the path contains spaces you should wrap it in quotes:

    zend_extension="C:\Program Files\PHP5.5\ext\php_opcache.dll"

    Try it out and see if it helps

    0 讨论(0)
  • 2020-12-30 09:33

    In PHP5.5.12 opcache is delivered as a zend extension but it is found in the standard ext folder.

    You would therefore load it just like any other PHP extension, apart from using the zend_extension rather than extension paramter, so edit your php.ini file using the wampmanager menus to make sure you edit the right file like so :-

    wampmanager -> PHP -> php.ini
    

    First check that this parameter is set correctly :

    extension_dir = "C:/wamp/bin/php/php5.5.12/ext/"
    

    Now where you have loaded the OpCache dll in your example, do it like this and it will be loaded from the default extension folder just like a normal extension= would be :-

    zend_extension=php_opcache.dll
    

    You could do it like this :-

    zend_extension="C:/wamp/bin/php/php5.5.12/ext/php_opcache.dll"
    

    but there is no need to specify the full path as it is loaded from the standard ext folder.

    Warning

    If you are still developing you almost definitely don't what this turned on as it won't add any benefit and could add time to a standard compilation, recaching after every code change, and possibly not re-compiling and using the cached code when you don't want it to.

    0 讨论(0)
提交回复
热议问题