forked from littlebizzy/slickstack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathss-install-php-config.txt
493 lines (405 loc) · 18.6 KB
/
ss-install-php-config.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
#!/bin/bash
####################################################################################################
#### author: SlickStack ############################################################################
#### link: https://slickstack.io ###################################################################
#### mirror: https://mirrors.slickstack.io/bash/ss-install-php-config.txt ##########################
#### path: /var/www/ss-install-php-config ##########################################################
#### destination: n/a (not a boilerplate) ##########################################################
#### purpose: Reinstalls the PHP-FPM module config files based on ss-config (idempotent) ###########
#### module version: PHP-FPM 8.1.x #################################################################
#### sourced by: ss-install ########################################################################
#### bash aliases: ss install php config ###########################################################
####################################################################################################
## SS-CONFIG MUST BE PROPERLY CONFIGURED AND ON CURRENT BUILD BEFORE RUNNING SS-INSTALL ##
## ENSURE YOUR SS-CONFIG BUILD REMAINS CURRENT BY RUNNING SS-UPDATE OCCASIONALLY ##
## source ss-config ##
source /var/www/ss-config
## source ss-functions ##
source /var/www/ss-functions
## BELOW THIS RELIES ON SS-CONFIG AND SS-FUNCTIONS
####################################################################################################
#### TABLE OF CONTENTS (SS-Install-PHP-Config) #####################################################
####################################################################################################
## this is a brief summary of the different code snippets you will find in this script ##
## each section should be commented so you understand what is being accomplished ##
## A. Touch Timestamp File
## B. Message (Begin Script)
## C. Retrieve Current Boilerplates
## E. Install PHP-FPM.conf
## F. Install WWW.conf
####################################################################################################
#### A. SS-Install-PHP-Config: Touch Timestamp File ################################################
####################################################################################################
## this is a dummy timestamp file that will remember the last time this script was run ##
## it can be useful for developer reference and is sometimes used by SlickStack ##
## script timestamp ##
ss_touch "${TIMESTAMP_SS_INSTALL_PHP_CONFIG}"
####################################################################################################
#### B. SS-Install-PHP-Config: Message (Begin Script) ##############################################
####################################################################################################
## this is a simple message that announces to the shell the purpose of this bash script ##
## it will only be noticed by sudo users who manually call ss core bash scripts ##
## echo message ##
ss_echo "${COLOR_INFO}Running ss-install-php-config... ${COLOR_RESET}"
####################################################################################################
#### C. SS-Install-PHP-Config: Retrieve Current Boilerplates #######################################
####################################################################################################
## next we optimize the PHP-FPM configuration files based on settings from ss-config ##
## several common PHP settings are hardcoded to improve LEMP server stability ##
## download latest versions ##
if [[ "${UBUNTU_VERSION}" == "22.04" ]]; then
ss_wget "${TMP_PHP_FPM_CONF}" "${MIRROR_PHP_FPM_CONF_81}"
ss_wget "${TMP_PHP_INI}" "${MIRROR_PHP_INI_81}"
ss_wget "${TMP_WWW_CONF}" "${MIRROR_WWW_CONF_81}"
fi
if [[ "${UBUNTU_VERSION}" == "20.04" ]]; then
ss_wget "${TMP_PHP_FPM_CONF}" "${MIRROR_PHP_FPM_CONF}"
ss_wget "${TMP_PHP_INI}" "${MIRROR_PHP_INI}"
ss_wget "${TMP_WWW_CONF}" "${MIRROR_WWW_CONF}"
fi
if [[ "${UBUNTU_VERSION}" == "18.04" ]]; then
ss_wget "${TMP_PHP_FPM_CONF}" "${MIRROR_PHP_FPM_CONF_72}"
ss_wget "${TMP_PHP_INI}" "${MIRROR_PHP_INI_72}"
ss_wget "${TMP_WWW_CONF}" "${MIRROR_WWW_CONF_72}"
fi
####################################################################################################
#### SS-Install-PHP-Config: Configure PHP.ini Boilerplate (Per Ubuntu Version) #####################
####################################################################################################
## max execution time ##
if [[ -z "$PHP_MAX_EXECUTION_TIME" ]]; then
sed -i "s/@PHP_MAX_EXECUTION_TIME/60/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_MAX_EXECUTION_TIME/${PHP_MAX_EXECUTION_TIME}/g" "$TMP_PHP_INI"
fi
## max input time ##
if [[ -z "$PHP_MAX_INPUT_TIME" ]]; then
sed -i "s/@PHP_MAX_INPUT_TIME/60/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_MAX_INPUT_TIME/${PHP_MAX_INPUT_TIME}/g" "$TMP_PHP_INI"
fi
## memory limit ##
if [[ -z "$PHP_MEMORY_LIMIT" ]]; then
sed -i "s/@PHP_MEMORY_LIMIT/512M/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_MEMORY_LIMIT/${PHP_MEMORY_LIMIT}/g" "$TMP_PHP_INI"
fi
## max input vars ##
if [[ -z "$PHP_MAX_INPUT_VARS" ]]; then
sed -i "s/@PHP_MAX_INPUT_VARS/5000/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_MAX_INPUT_VARS/${PHP_MAX_INPUT_VARS}/g" "$TMP_PHP_INI"
fi
## max input nesting level ##
if [[ -z "$PHP_MAX_INPUT_NESTING_LEVEL" ]]; then
sed -i "s/@PHP_MAX_INPUT_NESTING_LEVEL/64/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_MAX_INPUT_NESTING_LEVEL/${PHP_MAX_INPUT_NESTING_LEVEL}/g" "$TMP_PHP_INI"
fi
## upload max filesize ##
if [[ -z "$PHP_UPLOAD_MAX_FILESIZE" ]]; then
sed -i "s/@PHP_UPLOAD_MAX_FILESIZE/512M/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_UPLOAD_MAX_FILESIZE/${PHP_UPLOAD_MAX_FILESIZE}/g" "$TMP_PHP_INI"
fi
## max file uploads ##
if [[ -z "$PHP_MAX_FILE_UPLOADS" ]]; then
sed -i "s/@PHP_MAX_FILE_UPLOADS/100/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_MAX_FILE_UPLOADS/${PHP_MAX_FILE_UPLOADS}/g" "$TMP_PHP_INI"
fi
## php precision ##
if [[ -z "$PHP_PRECISION" ]]; then
sed -i "s/@PHP_PRECISION/14/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_PRECISION/${PHP_PRECISION}/g" "$TMP_PHP_INI"
fi
## php output buffering ##
if [[ -z "$PHP_OUTPUT_BUFFERING" ]]; then
sed -i "s/@PHP_OUTPUT_BUFFERING/4096/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_OUTPUT_BUFFERING/${PHP_OUTPUT_BUFFERING}/g" "$TMP_PHP_INI"
fi
## php unserialize max depth ##
if [[ -z "$PHP_UNSERIALIZE_MAX_DEPTH" ]]; then
sed -i "s/@PHP_UNSERIALIZE_MAX_DEPTH/4096/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_UNSERIALIZE_MAX_DEPTH/${PHP_UNSERIALIZE_MAX_DEPTH}/g" "$TMP_PHP_INI"
fi
## php serialize precision ##
if [[ -z "$PHP_SERIALIZE_PRECISION" ]]; then
sed -i "s/@PHP_SERIALIZE_PRECISION/-1/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_SERIALIZE_PRECISION/${PHP_SERIALIZE_PRECISION}/g" "$TMP_PHP_INI"
fi
## php allow url fopen ##
if [[ -z "$PHP_ALLOW_URL_FOPEN" ]]; then
sed -i "s/@PHP_ALLOW_URL_FOPEN/On/g" "$TMP_PHP_INI"
elif [[ "$PHP_ALLOW_URL_FOPEN" == "true" ]]; then
sed -i "s/@PHP_ALLOW_URL_FOPEN/On/g" "$TMP_PHP_INI"
elif [[ "$PHP_ALLOW_URL_FOPEN" == "On" ]]; then
sed -i "s/@PHP_ALLOW_URL_FOPEN/On/g" "$TMP_PHP_INI"
elif [[ "$PHP_ALLOW_URL_FOPEN" == "false" ]]; then
sed -i "s/@PHP_ALLOW_URL_FOPEN/Off/g" "$TMP_PHP_INI"
elif [[ "$PHP_ALLOW_URL_FOPEN" == "Off" ]]; then
sed -i "s/@PHP_ALLOW_URL_FOPEN/Off/g" "$TMP_PHP_INI"
fi
## php default socket timeout ##
if [[ -z "$PHP_DEFAULT_SOCKET_TIMEOUT" ]]; then
sed -i "s/@PHP_DEFAULT_SOCKET_TIMEOUT/60/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_DEFAULT_SOCKET_TIMEOUT/${PHP_DEFAULT_SOCKET_TIMEOUT}/g" "$TMP_PHP_INI"
fi
## php post max size ##
if [[ -z "$PHP_POST_MAX_SIZE" ]]; then
sed -i "s/@PHP_POST_MAX_SIZE/512M/g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_POST_MAX_SIZE/${PHP_POST_MAX_SIZE}/g" "$TMP_PHP_INI"
fi
## php disable classes ##
if [[ -z "$PHP_DISABLE_CLASSES" ]]; then
sed -i "s/@PHP_DISABLE_CLASSES//g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_DISABLE_CLASSES/${PHP_DISABLE_CLASSES}/g" "$TMP_PHP_INI"
fi
## php disable functions ##
if [[ -z "$PHP_DISABLE_FUNCTIONS" ]]; then
sed -i "s/@PHP_DISABLE_FUNCTIONS//g" "$TMP_PHP_INI"
else
sed -i "s/@PHP_DISABLE_FUNCTIONS/${PHP_DISABLE_FUNCTIONS}/g" "$TMP_PHP_INI"
fi
## opcache huge code pages ##
if [[ -z "$OPCACHE_HUGE_CODE_PAGES" ]]; then
sed -i "s/@OPCACHE_HUGE_CODE_PAGES/0/g" "$TMP_PHP_INI"
elif [[ "$OPCACHE_HUGE_CODE_PAGES" == "true" ]]; then
sed -i "s/@OPCACHE_HUGE_CODE_PAGES/1/g" "$TMP_PHP_INI"
elif [[ "$OPCACHE_HUGE_CODE_PAGES" == "On" ]]; then
sed -i "s/@OPCACHE_HUGE_CODE_PAGES/1/g" "$TMP_PHP_INI"
elif [[ "$OPCACHE_HUGE_CODE_PAGES" == "false" ]]; then
sed -i "s/@OPCACHE_HUGE_CODE_PAGES/0/g" "$TMP_PHP_INI"
elif [[ "$OPCACHE_HUGE_CODE_PAGES" == "Off" ]]; then
sed -i "s/@OPCACHE_HUGE_CODE_PAGES/0/g" "$TMP_PHP_INI"
fi
## opcache revalidate frequency ##
if [[ -z "$OPCACHE_REVALIDATE_FREQUENCY" ]]; then
sed -i "s/@OPCACHE_REVALIDATE_FREQUENCY/2/g" "$TMP_PHP_INI"
else
sed -i "s/@OPCACHE_REVALIDATE_FREQUENCY/${OPCACHE_REVALIDATE_FREQUENCY}/g" "$TMP_PHP_INI"
fi
## opcache max wasted percentage ##
if [[ -z "$OPCACHE_MAX_WASTED_PERCENTAGE" ]]; then
sed -i "s/@OPCACHE_MAX_WASTED_PERCENTAGE/5/g" "$TMP_PHP_INI"
else
sed -i "s/@OPCACHE_MAX_WASTED_PERCENTAGE/${OPCACHE_MAX_WASTED_PERCENTAGE}/g" "$TMP_PHP_INI"
fi
## opcache max accelerated files ##
if [[ -z "$OPCACHE_MAX_ACCELERATED_FILES" ]]; then
sed -i "s/@OPCACHE_MAX_ACCELERATED_FILES/10000/g" "$TMP_PHP_INI"
else
sed -i "s/@OPCACHE_MAX_ACCELERATED_FILES/${OPCACHE_MAX_ACCELERATED_FILES}/g" "$TMP_PHP_INI"
fi
## opcache interned strings buffer ##
if [[ -z "$OPCACHE_INTERNED_STRINGS_BUFFER" ]]; then
sed -i "s/@OPCACHE_INTERNED_STRINGS_BUFFER/64/g" "$TMP_PHP_INI"
else
sed -i "s/@OPCACHE_INTERNED_STRINGS_BUFFER/${OPCACHE_INTERNED_STRINGS_BUFFER}/g" "$TMP_PHP_INI"
fi
## opcache memory consumption ##
if [[ -z "$OPCACHE_MEMORY_CONSUMPTION" ]]; then
sed -i "s/@OPCACHE_MEMORY_CONSUMPTION/256/g" "$TMP_PHP_INI"
else
sed -i "s/@OPCACHE_MEMORY_CONSUMPTION/${OPCACHE_MEMORY_CONSUMPTION}/g" "$TMP_PHP_INI"
fi
## newer stuff ##
## opcache preload ##
if [[ -z "$OPCACHE_PRELOAD" ]]; then
sed -i "s/@OPCACHE_PRELOAD/0/g" "$TMP_PHP_INI"
else
sed -i "s/@OPCACHE_PRELOAD/${OPCACHE_PRELOAD}/g" "$TMP_PHP_INI"
fi
## opcache blacklist filename ##
if [[ -z "$OPCACHE_BLACKLIST_FILENAME" ]]; then
sed -i "s/@OPCACHE_BLACKLIST_FILENAME//g" "$TMP_PHP_INI"
else
sed -i "s/@OPCACHE_BLACKLIST_FILENAME/${OPCACHE_BLACKLIST_FILENAME}/g" "$TMP_PHP_INI"
fi
####################################################################################################
#### SS-Install-PHP-Config: Configure PHP-FPM.conf Boilerplate (Per Ubuntu Version) ################
####################################################################################################
## emerg restart threshold ##
if [[ -z "$FPM_EMERGENCY_RESTART_THRESHOLD" ]]; then
sed -i "s/@FPM_EMERGENCY_RESTART_THRESHOLD/10/g" /tmp/php-fpm.conf
else
sed -i "s/@FPM_EMERGENCY_RESTART_THRESHOLD/${FPM_EMERGENCY_RESTART_THRESHOLD}/g" /tmp/php-fpm.conf
fi
## emerg restart time ##
if [[ -z "$FPM_EMERGENCY_RESTART_INTERVAL" ]]; then
sed -i "s/@FPM_EMERGENCY_RESTART_INTERVAL/1m/g" /tmp/php-fpm.conf
else
sed -i "s/@FPM_EMERGENCY_RESTART_INTERVAL/${FPM_EMERGENCY_RESTART_INTERVAL}/g" /tmp/php-fpm.conf
fi
## process control timeout ##
if [[ -z "$FPM_PROCESS_CONTROL_TIMEOUT" ]]; then
sed -i "s/@FPM_PROCESS_CONTROL_TIMEOUT/10s/g" /tmp/php-fpm.conf
else
sed -i "s/@FPM_PROCESS_CONTROL_TIMEOUT/${FPM_PROCESS_CONTROL_TIMEOUT}/g" /tmp/php-fpm.conf
fi
## process max ##
if [[ -z "$FPM_PROCESS_MAX" ]]; then
sed -i "s/@FPM_PROCESS_MAX/128/g" /tmp/php-fpm.conf
else
sed -i "s/@FPM_PROCESS_MAX/${FPM_PROCESS_MAX}/g" /tmp/php-fpm.conf
fi
## process priority ##
if [[ -z "$FPM_PROCESS_PRIORITY" ]]; then
sed -i "s/@FPM_PROCESS_PRIORITY/-19/g" /tmp/php-fpm.conf
else
sed -i "s/@FPM_PROCESS_PRIORITY/${FPM_PROCESS_PRIORITY}/g" /tmp/php-fpm.conf
fi
## rlimit files ##
if [[ -z "$FPM_RLIMIT_FILES" ]]; then
sed -i "s/@FPM_RLIMIT_FILES/1024/g" /tmp/php-fpm.conf
else
sed -i "s/@FPM_RLIMIT_FILES/${FPM_RLIMIT_FILES}/g" /tmp/php-fpm.conf
fi
## rlimit core ##
if [[ -z "$FPM_RLIMIT_CORE" ]]; then
sed -i "s/@FPM_RLIMIT_CORE/0/g" /tmp/php-fpm.conf
else
sed -i "s/@FPM_RLIMIT_CORE/${FPM_RLIMIT_CORE}/g" /tmp/php-fpm.conf
fi
## systemd interval ##
if [[ -z "$FPM_SYSTEMD_INTERVAL" ]]; then
sed -i "s/@FPM_SYSTEMD_INTERVAL/10/g" /tmp/php-fpm.conf
else
sed -i "s/@FPM_SYSTEMD_INTERVAL/${FPM_SYSTEMD_INTERVAL}/g" /tmp/php-fpm.conf
fi
####################################################################################################
#### SS-Install-PHP-Config: Configure WWW.conf Boilerplate (Per Ubuntu Version) ####################
####################################################################################################
## pool listen backlog ##
if [[ -z "$WWW_LISTEN_BACKLOG" ]]; then
sed -i "s/@WWW_LISTEN_BACKLOG/65535/g" /tmp/www.conf
else
sed -i "s/@WWW_LISTEN_BACKLOG/${WWW_LISTEN_BACKLOG}/g" /tmp/www.conf
fi
## pool type ##
if [[ -z "$WWW_PM_MODE" ]]; then
sed -i "s/@WWW_PM_MODE/ondemand/g" /tmp/www.conf
else
sed -i "s/@WWW_PM_MODE/${WWW_PM_MODE}/g" /tmp/www.conf
fi
## pool max children ##
if [[ -z "$WWW_PM_MAX_CHILDREN" ]]; then
sed -i "s/@WWW_PM_MAX_CHILDREN/20/g" /tmp/www.conf
else
sed -i "s/@WWW_PM_MAX_CHILDREN/${WWW_PM_MAX_CHILDREN}/g" /tmp/www.conf
fi
## pool start servers ##
if [[ -z "$WWW_PM_START_SERVERS" ]]; then
sed -i "s/@WWW_PM_START_SERVERS/2/g" /tmp/www.conf
else
sed -i "s/@WWW_PM_START_SERVERS/${WWW_PM_START_SERVERS}/g" /tmp/www.conf
fi
## pool min spare servers ##
if [[ -z "$WWW_PM_MIN_SPARE_SERVERS" ]]; then
sed -i "s/@WWW_PM_MIN_SPARE_SERVERS/1/g" /tmp/www.conf
else
sed -i "s/@WWW_PM_MIN_SPARE_SERVERS/${WWW_PM_MIN_SPARE_SERVERS}/g" /tmp/www.conf
fi
## pool max spare servers ##
if [[ -z "$WWW_PM_MAX_SPARE_SERVERS" ]]; then
sed -i "s/@WWW_PM_MAX_SPARE_SERVERS/3/g" /tmp/www.conf
else
sed -i "s/@WWW_PM_MAX_SPARE_SERVERS/${WWW_PM_MAX_SPARE_SERVERS}/g" /tmp/www.conf
fi
## pool max spawn rate ##
if [[ -z "$WWW_PM_MAX_SPAWN_RATE" ]]; then
sed -i "s/@WWW_PM_MAX_SPAWN_RATE/32/g" /tmp/www.conf
else
sed -i "s/@WWW_PM_MAX_SPAWN_RATE/${WWW_PM_MAX_SPAWN_RATE}/g" /tmp/www.conf
fi
## pool process idle timeout ##
if [[ -z "$WWW_PM_PROCESS_IDLE_TIMEOUT" ]]; then
sed -i "s/@WWW_PM_PROCESS_IDLE_TIMEOUT/10s/g" /tmp/www.conf
else
sed -i "s/@WWW_PM_PROCESS_IDLE_TIMEOUT/${WWW_PM_PROCESS_IDLE_TIMEOUT}/g" /tmp/www.conf
fi
## pool max requests ##
if [[ -z "$WWW_PM_MAX_REQUESTS" ]]; then
sed -i "s/@WWW_PM_MAX_REQUESTS/500/g" /tmp/www.conf
else
sed -i "s/@WWW_PM_MAX_REQUESTS/${WWW_PM_MAX_REQUESTS}/g" /tmp/www.conf
fi
## pool request terminate timeout ##
if [[ -z "$WWW_REQUEST_TERMINATE_TIMEOUT" ]]; then
sed -i "s/@WWW_REQUEST_TERMINATE_TIMEOUT/300/g" /tmp/www.conf
else
sed -i "s/@WWW_REQUEST_TERMINATE_TIMEOUT/${WWW_REQUEST_TERMINATE_TIMEOUT}/g" /tmp/www.conf
fi
## pool rlimit files ##
if [[ -z "$WWW_RLIMIT_FILES" ]]; then
sed -i "s/@WWW_RLIMIT_FILES/65535/g" /tmp/www.conf
else
sed -i "s/@WWW_RLIMIT_FILES/${WWW_RLIMIT_FILES}/g" /tmp/www.conf
fi
## pool rlimit core ##
if [[ -z "$WWW_RLIMIT_CORE" ]]; then
sed -i "s/@WWW_RLIMIT_CORE/0/g" /tmp/www.conf
else
sed -i "s/@WWW_RLIMIT_CORE/${WWW_RLIMIT_CORE}/g" /tmp/www.conf
fi
####################################################################################################
#### SS-Install-PHP-Config: Copy Configuration Files To Destination (PHP-FPM) ######################
####################################################################################################
if [[ "${SS_APP}" != "mysql" ]]; then
## ubuntu 22.04 ##
if [[ "${UBUNTU_VERSION}" == "22.04" ]]; then
ss_mv "${TMP_PHP_FPM_CONF}" "${PATH_PHP_FPM_CONF_81}"
ss_cp "${TMP_PHP_INI}" "${PATH_PHP_INI_FPM_81}"
ss_cp "${TMP_PHP_INI}" "${PATH_PHP_INI_CLI_81}"
ss_mv "${TMP_WWW_CONF}" "${PATH_WWW_CONF_81}"
fi
## ubuntu 20.04 ##
if [[ "${UBUNTU_VERSION}" == "20.04" ]]; then
ss_mv "${TMP_PHP_FPM_CONF}" "${PATH_PHP_FPM_CONF_74}"
ss_cp "${TMP_PHP_INI}" "${PATH_PHP_INI_FPM_74}"
ss_cp "${TMP_PHP_INI}" "${PATH_PHP_INI_CLI_74}"
ss_mv "${TMP_WWW_CONF}" "${PATH_WWW_CONF_74}"
fi
## ubuntu 18.04 ##
if [[ "${UBUNTU_VERSION}" == "18.04" ]]; then
ss_mv "${TMP_PHP_FPM_CONF}" "${PATH_PHP_FPM_CONF_72}"
ss_cp "${TMP_PHP_INI}" "${PATH_PHP_INI_FPM_72}"
ss_cp "${TMP_PHP_INI}" "${PATH_PHP_INI_CLI_72}"
ss_mv "${TMP_WWW_CONF}" "${PATH_WWW_CONF_72}"
fi
fi
####################################################################################################
#### SS-Install-PHP-Config: Reset Permissions (PHP-FPM) ############################################
####################################################################################################
## run ss-perms-php-config ##
source "${PATH_SS_PERMS_PHP_CONFIG}"
####################################################################################################
#### SS-Install-PHP-Config: Restart Services (PHP-FPM) #############################################
####################################################################################################
## run ss-restart-php ##
source "${PATH_SS_RESTART_PHP}"
####################################################################################################
#### PLACEHOLDER: Reset Permissions (SlickStack Scripts) ###########################################
####################################################################################################
## we include this permissions reset in all cron jobs and bash scripts for redundancy ##
## chmod 0700 means only the root/sudo users can execute any SlickStack scripts ##
## THIS SNIPPET DOES NOT RELY ON SS-CONFIG OR SS-FUNCTIONS
## SNIPPET: ss bash scripts, ss cron jobs
## UPDATED: 02JUL2022
chown root:root /var/www/ss* ## must be root:root
chown root:root /var/www/crons/*cron* ## must be root:root
chown root:root /var/www/crons/custom/*cron* ## must be root:root
chmod 0700 /var/www/ss* ## 0700 means only root/sudo can execute
chmod 0700 /var/www/crons/*cron* ## 0700 means only root/sudo can execute
chmod 0700 /var/www/crons/custom/*cron* ## 0700 means only root/sudo can execute
####################################################################################################
#### SlickStack: External References Used To Improve This Script (Thanks, Interwebz) ###############
####################################################################################################
## Ref:
## SS_EOF