AlexMasterov / dockerfiles

:whale: Common Dockerfiles, used for development
56 stars 18 forks source link

Error running php jit tag #6

Closed fezfez closed 7 years ago

fezfez commented 7 years ago

When i run php jit tag i got this error :

[17-May-2017 05:16:34] ERROR: failed to open configuration file '/etc/php/php-fpm.conf': No such file or directory (2)
[17-May-2017 05:16:34] ERROR: failed to load configuration file '/etc/php/php-fpm.conf'
[17-May-2017 05:16:34] ERROR: FPM initialization failed

How to correct this error ?

Thanks for your works !

AlexMasterov commented 7 years ago

Docker files for PHP does not contain configuration files, even those that are installed by default. There are reasons for this, but I'm thinking about to add.

While you can add the minimum configuration:

data/php/php-fpm.conf

[global]
pid = /var/run/php7-fpm.pid

daemonize = no

log_level = notice
error_log = /dev/stderr

[www]
user = www-data
group = www-data

listen = /var/run/php7-fpm.sock
listen.allowed_clients = any
listen.backlog = 65536
listen.group = www-data
listen.mode = 0666
listen.owner = www-data

pm = dynamic
pm.start_servers = 2
pm.max_children = 10
pm.max_requests = 0
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.process_idle_timeout = 20s;

data/php/conf.d/010-opcache.ini

zend_extension=opcache.so

[opcache]
opcache.enable = On
opcache.enable_cli = Off

; JIT specific
opcache.jit = 35
opcache.jit_buffer_size = 32M

docker

docker run -i -v $(pwd)/data/php:/etc/php php:jit

docker-compose

# ... <basic configuration>
volumes:
  - ./data/php:/etc/php
fezfez commented 7 years ago

thanks 👍