Skip to content
This repository was archived by the owner on Mar 15, 2019. It is now read-only.

Commit f75f81c

Browse files
author
Julien Neuhart
committed
refactoring .ini conf.d
1 parent 3801c0c commit f75f81c

25 files changed

+255
-1884
lines changed

_bin/prepare/_prepare_apache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ source ${ROOT}/.env;
88

99
/bin/bash ${ROOT}/_bin/utils/_sedi "s/\${APACHE_SERVICE_NAME}/${APACHE_SERVICE_NAME}/g" ${ROOT}/docker-compose.yml;
1010
/bin/bash ${ROOT}/_bin/utils/_sedi "s/\${APACHE_CONTAINER_NAME}/${APACHE_CONTAINER_NAME}/g" ${ROOT}/docker-compose.yml;
11+
/bin/bash ${ROOT}/_bin/utils/_sedi "s/\${APACHE_ENABLE_XDEBUG}/${APACHE_ENABLE_XDEBUG}/g" ${ROOT}/docker-compose.yml;
1112
/bin/bash ${ROOT}/_bin/utils/_sedi "s/- VIRTUAL_HOST=\${APACHE_VIRTUAL_HOST}/- VIRTUAL_HOST=${APACHE_VIRTUAL_HOST}/g" ${ROOT}/docker-compose.yml;
1213
/bin/bash ${ROOT}/_bin/utils/_sedi "s/\${USER_ID}/$(id -u)/g" ${ROOT}/docker-compose.yml; # permissions issues workaround
1314
/bin/bash ${ROOT}/_bin/utils/_sedi "s/\${REVERSE_PROXY_NAME}/${REVERSE_PROXY_NAME}/g" ${ROOT}/docker-compose.yml;

apache/Dockerfile

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,18 @@ RUN docker-php-ext-install -j$(nproc) iconv mcrypt \
2828
&& docker-php-ext-install -j$(nproc) gd \
2929
&& docker-php-ext-install opcache \
3030
&& docker-php-ext-install pdo_mysql \
31-
&& pecl install apcu \
32-
&& pecl install xdebug
31+
&& pecl install apcu
32+
33+
ARG ENABLE_XDEBUG
34+
RUN if [ ${ENABLE_XDEBUG} = 1 ]; then \
35+
pecl install xdebug \
36+
;fi
37+
38+
RUN rm -rf /usr/local/etc/php/conf.d
39+
COPY conf.d /usr/local/etc/php/conf.d
3340

3441
# enables cron
35-
ADD crontab /tmp/
42+
COPY crontab /tmp/
3643
RUN crontab /tmp/crontab
3744

3845
# defines entry point

apache/conf.d/custom.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
; Customize this ini file at your convinience

apache/conf.d/ext-apcu.ini

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
extension=apcu.so
2+
3+
; This can be set to 0 to disable APCu
4+
apc.enabled=1
5+
6+
; Setting this enables APCu for the CLI version of PHP
7+
; (Mostly for testing and debugging).
8+
;apc.enable_cli=0
9+
10+
; Sets the path to text files containing caches to load from disk upon
11+
; initialization of APCu. preload_path should be a directory where each
12+
; file follows $key.data where $key should be used as the entry name
13+
; and the contents of the file contains serialized data to use as the value
14+
; of the entry.
15+
;apc.preload_path=
16+
17+
; The size of each shared memory segment, with M/G suffixe
18+
;apc.shm_size=32M
19+
20+
; The number of seconds a cache entry is allowed to idle in a slot in case
21+
; this cache entry slot is needed by another entry.
22+
;apc.ttl=0
23+
24+
; The number of seconds that a cache entry may remain on the
25+
; garbage-collection list.
26+
;apc.gc_ttl=3600
27+
28+
; If you begin to get low on resources, an expunge of the cache
29+
; is performed if it is less than half full. This is not always
30+
; a suitable way of determining if an expunge of the cache
31+
; should be per apc.smart allows you to set a runtime configuration
32+
; value which is used to determine if an expunge should be run
33+
; if (available_size < apc.smart * requested_size)
34+
;apc.smart=0
35+
36+
; A "hint" about the number variables expected in the cache.
37+
; Set to zero or omit if you are not sure;
38+
;apc.entries_hint=4096
39+
40+
; The mktemp-style file_mask to pass to the mmap module
41+
apc.mmap_file_mask=/tmp/apc.XXXXXX
42+
43+
; On very busy servers whenever you start the server or
44+
; modify files you can create a race of many processes
45+
; all trying to cache the same data at the same time.
46+
; By default, APCu attempts to prevent "slamming" of a key.
47+
; A key is considered "slammed" if it was the last key set,
48+
; and a context other than the current one set it ( ie. it
49+
; was set by another process or thread )
50+
;apc.slam_defense=1
51+
52+
; Defines which serializer should be used
53+
; Default is the standard PHP serializer.
54+
;apc.serializer='default'
55+
56+
; use the SAPI request start time for TTL
57+
;apc.use_request_time=1
58+
59+
; Enables APCu handling of signals, such as SIGSEGV, that write core files
60+
; when signaled. APCu will attempt to unmap the shared memory segment in
61+
; order to exclude it from the core file
62+
;apc.coredump_unmap=0
63+
64+
; RFC1867 File Upload Progress hook handler
65+
;apc.rfc1867=0
66+
;apc.rfc1867_prefix =upload_
67+
;apc.rfc1867_name=APC_UPLOAD_PROGRESS
68+
;apc.rfc1867_freq=0
69+
;apc.rfc1867_ttl=3600

apache/conf.d/ext-opcache.ini

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20160303/opcache.so
2+
3+
; OPcache On/Off switch. When set to Off, code is not optimized.
4+
; (default "1")
5+
opcache.enable = 1
6+
7+
; Enables the OPcache for the CLI version of PHP.
8+
; It's mostly for testing and debugging.
9+
; (default "0")
10+
opcache.enable_cli = 0
11+
12+
; The OPcache shared memory storage size.
13+
; The amount of memory for storing precompiled PHP code in Mbytes.
14+
; (default "64")
15+
opcache.memory_consumption = 64
16+
17+
; The amount of memory for interned strings in Mbytes.
18+
; (default "4")
19+
opcache.interned_strings_buffer = 4
20+
21+
; The maximum number of keys (scripts) in the OPcache hash table.
22+
; The number is actually the first one in the following set of prime numbers
23+
; that is bigger than the one supplied: { 223, 463, 983, 1979, 3907, 7963,
24+
; 16229, 32531, 65407, 130987, 262237, 524521, 1048793 }. Only numbers between
25+
; 200 and 1000000 are allowed.
26+
; (default "2000")
27+
opcache.max_accelerated_files = 2000
28+
29+
; The maximum percentage of "wasted" memory until a restart is scheduled.
30+
; (default "5")
31+
opcache.max_wasted_percentage = 5
32+
33+
; When this directive is enabled, the OPcache appends the current working
34+
; directory to the script key, thus eliminating possible collisions between
35+
; files with the same name (basename). Disabling the directive improves
36+
; performance, but may break existing applications.
37+
; (default "1")
38+
opcache.use_cwd = 1
39+
40+
; When disabled, you must reset the OPcache manually or restart the webserver
41+
; for changes to the filesystem to take effect. The frequency of the check is
42+
; controlled by the directive "opcache.revalidate_freq".
43+
; (default "1")
44+
opcache.validate_timestamps = 1
45+
46+
; How often (in seconds) to check file timestamps for changes to the shared
47+
; memory storage allocation. ("1" means validate once per second, but only once
48+
; per request. "0" means always validate)
49+
; (default "2")
50+
opcache.revalidate_freq = 2
51+
52+
; Prevents caching files that are less than this number of seconds old.
53+
; It protects from caching of incompletely updated files. In case all file
54+
; updates on your site are atomic, you may increase performance setting it
55+
; to "0".
56+
; (default "2")
57+
opcache.file_update_protection = 2
58+
59+
; Enables or disables file search in include_path optimization.
60+
; If the file search is disabled and a cached file is found that uses the same
61+
; include_path, the file is not searched again. Thus, if a file with the same
62+
; name appears somewhere else in include_path, it won't be found. Enable this
63+
; directive if this optimization has an effect on your applications. The
64+
; default for this directive is disabled, which means that optimization is
65+
; active.
66+
; (default "0")
67+
opcache.revalidate_path = 0
68+
69+
; If disabled, all PHPDoc comments are dropped from the code to reduce the size
70+
; of the optimized code. Disabling "Doc Comments" may break some existing
71+
; applications and frameworks (e.g. Doctrine, ZF2, PHPUnit)
72+
; (default "1")
73+
opcache.save_comments = 1
74+
75+
; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments" may
76+
; be always stored (save_comments=1), but not loaded by applications that don't
77+
; need them anyway.
78+
; (default "1")
79+
opcache.load_comments = 1
80+
81+
; If enabled, a fast shutdown sequence is used for the accelerated code. The
82+
; fast shutdown sequence doesn't free each allocated block, but lets the Zend
83+
; Engine Memory Manager do the work.
84+
; (default "0")
85+
opcache.fast_shutdown = 0
86+
87+
; Allow file existence override (file_exists, etc.) performance feature.
88+
; (default "0")
89+
opcache.enable_file_override = 0
90+
91+
; A bitmask, where each bit enables or disables the appropriate OPcache passes
92+
; (default "0xffffffff")
93+
opcache.optimization_level = 0xffffffff
94+
95+
; Enable this hack as a workaround for "can't redeclare class" errors.
96+
; The OPcache stores the places where DECLARE_CLASS opcodes use inheritance
97+
; (These are the only opcodes that can be executed by PHP, but which may not be
98+
; executed because the parent class is missing due to optimization). When the
99+
; file is loaded, OPcache tries to bind the inherited classes by using the
100+
; current environment. The problem with this scenario is that, while the
101+
; DECLARE_CLASS opcode may not be needed for the current script, if the script
102+
; requires that the opcode at least be defined, it may not run. The default for
103+
; this directive is disabled, which means that optimization is active. In
104+
; php-5.3 and above this hack is not needed anymore and this setting has no
105+
; effect.
106+
; (default "1")
107+
opcache.inherited_hack = 1
108+
109+
; The location of the OPcache blacklist file (wildcards allowed).
110+
; Each OPcache blacklist file is a text file that holds the names of files that
111+
; should not be accelerated. The file format is to add each filename to a new
112+
; line. The filename may be a full path or just a file prefix (i.e., /var/www/x
113+
; blacklists all the files and directories in /var/www that start with 'x').
114+
; Line starting with a ; are ignored (comments).
115+
; Files are usually triggered by one of the following three reasons:
116+
; 1) Directories that contain auto generated code, like Smarty or ZFW cache.
117+
; 2) Code that does not work well when accelerated, due to some delayed compile
118+
; time evaluation.
119+
; 3) Code that triggers an OPcache bug.
120+
; (default "")
121+
opcache.blacklist_filename = ""
122+
123+
; Allows exclusion of large files from being cached. By default all files are
124+
; cached.
125+
; (default "0")
126+
opcache.max_file_size = 0
127+
128+
; Check the cache checksum each N requests.
129+
; The default value of "0" means that the checks are disabled. Because
130+
; calculating the checksum impairs performance, this directive should be
131+
; enabled only as part of a debugging process.
132+
; (default "0")
133+
opcache.consistency_checks = 0
134+
135+
; How long to wait (in seconds) for a scheduled restart to begin if the cache
136+
; is not being accessed. The OPcache uses this directive to identify a
137+
; situation where there may be a problem with a process. After this time period
138+
; has passed, the OPcache assumes that something has happened and starts
139+
; killing the processes that still hold the locks that are preventing a
140+
; restart. If the log level is 3 or above, a "killed locker" error is recorded
141+
; in the Apache logs when this happens.
142+
; (default "180")
143+
opcache.force_restart_timeout = 180
144+
145+
; OPcache error_log file name. Empty string assumes "stderr".
146+
; (default "" which means stderr)
147+
opcache.error_log = ""
148+
149+
; All OPcache errors go to the Web server log.
150+
; By default, only fatal errors (level 0) or errors (level 1) are logged. You
151+
; can also enable warnings (level 2), info messages (level 3) or debug messages
152+
; (level 4).
153+
; (default "1")
154+
opcache.log_verbosity_level = 1
155+
156+
; Preferred Shared Memory back-end. Leave empty and let the system decide.
157+
; (default "")
158+
opcache.preferred_memory_model = ""
159+
160+
; Protect the shared memory from unexpected writing during script execution.
161+
; Useful for internal debugging only.
162+
; (default "0")
163+
opcache.protect_memory = 0
164+
165+
; Mapping base of shared memory segments (for Windows only). All the PHP
166+
; processes have to map shared memory into the same address space. This
167+
; directive allows to manually fix the "Unable to reattach to base address"
168+
; errors.
169+
;opcache.mmap_base = ""
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
[xdebug]
2-
zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
1+
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
32

43
; Remote settings
54
xdebug.remote_autostart=on

apache/ext-apcu.ini

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)