Windows, XAMPP, PHP 7 and opcache

浪子不回头ぞ 提交于 2019-12-01 02:57:34
Key Shang

Your php_opcache.dll path seems wrong, you need write it like below, it works for me.

[opcache]
zend_extension=C:\xampp\php\ext\php_opcache.dll
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=256
opcache.max_accelerated_files=2000

More details

If your XAMPP comes with PHP 5.5+ by default, opcache already included in the bundle, you will just need to enable it. To enable the extension:

  1. Open php.ini (by default it should be located here: C:\xampp\php\php.ini).

  2. Add this line at the end of the file: zend_extension=C:\xampp\php\ext\php_opcache.dll

  3. Restart Apache server.

open a php.ini file

  1. Change the ;opcache.enable=1 to opcache.enable=1
  2. Add opcache dll path at the end of the file zend_extension = "C:\xampp\php\ext\php_opcache.dll"
  3. Restart apache

for more reference check this video https://www.youtube.com/watch?v=GvWrNoRDjUY

To be honest - do not use xammp. Right now we have a bit better tech stack, to run PHP on Linux servers. Docker https://docs.docker.com/docker-for-windows/

Vagrant: https://www.vagrantup.com/

Both of them are based on linux systems, where most of xammp problems will not have place.

In case of Xampp, just put the below lines next to [opcache]

zend_extension="C:\xampp\php\ext\php_opcache.dll"
opcache.enable=1
opcache.enable_cli=1
opcache.memory_consumption=256
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=4000
opcache.revalidate_freq=60
opcache.fast_shutdown=1
Chetan Bhosale

Creeating directory with appropriate permissions and setting it php.ini worked!

opcache.file_cache=d:\xampp\htdocs\opcache
Sergey Matunin
ThreadStackSize 8388608 

Helped me in the similar case. This is a httpd option.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!