Windows, XAMPP, PHP 7, and opcache

I installed the latest XAMPP server with PHP 7 (update: also checked PHP 7.1) (on my Windows 10 system). I wanted to use opcache , so I included it in php.ini .

 [opcache] zend_extension=php_opcache.dll opcache.enable=1 opcache.enable_cli=0 opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 

Now with this change and almost every page refresh, I get this error from Apache:

 AH00428: Parent: child process 3748 exited with status 3221226356 -- Restarting. 

So the page is loading and loading ... waiting for Apache to start. When I turn off opcache (by setting opcache.enable=0 ), Apache does not restart and everything works fine (of course, skipping the slower theme of the web application).

Everything works fine when loading an application on XAMPP with PHP 5.6 with opcache enabled.

UPDATE (GIF image added):
As you can see, sometimes the page is updated, as it should be. But sometimes it updates much longer, and at that moment Apache restarts.

enter image description here

EDIT:
To be honest, I abandoned this application and worked with PHP on Windows (I worked on it for about 10 years with PHP & lt; = 5.6). It is very difficult / impossible (yet) to make PHP 7.x work on this OS (with Opcache). I decided to use Ubuntu and the server created using Docker . Everything is easier to configure (especially with Docker) and works faster. I advise everyone to do the same;).

+12
source share
6 answers

Your php_opcache.dll path seems incorrect , you need to write it as shown 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 is already included, you just need to enable it. To enable the extension:

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

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

  3. Restart the Apache server.
+13
source

open php.ini file

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

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

+4
source

To be honest, do not use xammp. Right now we have a slightly better technical stack for running PHP on Linux servers. docker https://docs.docker.com/docker-for-windows/

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

Both are based on Linux systems, where most xammp problems will not occur.

+1
source

For Xampp, just put the following 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 
+1
source

A container directory with the appropriate permissions and its php.ini settings!

 opcache.file_cache=d:\xampp\htdocs\opcache 
0
source
 ThreadStackSize 8388608 

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

0
source

Source: https://habr.com/ru/post/1260952/


All Articles