-
-
Notifications
You must be signed in to change notification settings - Fork 159
/
php_upgrade.inc
1222 lines (1064 loc) · 44.2 KB
/
php_upgrade.inc
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
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
########################################################################
autodetectextensions() {
# on minor PHP version updates, auto detect is skipped for these
# extensions recompilation to speed up php recompiles. However, if php
# extension fails to compile, there is currently no menu option to
# recompile mssql, mongodb and mailparse php extensions unless you
# switch PHP major versions i.e. go from PHP 5.6 to 7.0 or 7.0 to 7.1
# or 7.0 to 5.6. This quick workaround sets AUTODETECPHP_OVERRIDE='y'
# when PHPMYYSQL='y' or # PHPMONGODB='y' or PHPMAILPARSE='y' is set
# to enable these php extensions and php extension is detected as not
# loaded into php. So that even on mionor PHP version updates the
# extensions are recompiled.
if [[ "$PHPMSSQL" = [yY] && "$(php --ri mssql | grep -o 'not present')" = 'not present' ]] || [[ "$PHPMONGODB" = [yY] && "$(php --ri mongodb | grep -o 'not present')" = 'not present' ]] || [[ "$PHPMAILPARSE" = [yY] && "$(php --ri mailparse | grep -o 'not present')" = 'not present' ]]; then
AUTODETECPHP_OVERRIDE='y'
fi
if [[ -f "${CONFIGSCANDIR}/mssql.ini" && "$PHPMSSQL" = [yY] ]]; then
DETECTMSSQL=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTMSSQL=y
fi
if [ -f "${CONFIGSCANDIR}/xcache.ini" ]; then
DETECTXCACHE=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTXCACHE=y
fi
if [ -f "${CONFIGSCANDIR}/apc.ini" ]; then
DETECTAPC=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTAPC=y
fi
if [ -f "${CONFIGSCANDIR}/igbinary.ini" ]; then
if [[ "$PHPMUVER" != 'NGDEBUG' ]]; then
DETECTIGBINARY=y
else
# remove igbinary.ini when PHP NGDEBUG detected on upgrade
DETECTIGBINARY=n
echo "rm -rf ${CONFIGSCANDIR}/igbinary.ini"
rm -rf "${CONFIGSCANDIR}/igbinary.ini"
fi
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTIGBINARY=y
fi
if [[ -f "${CONFIGSCANDIR}/memcache.ini" || -f "${CONFIGSCANDIR}/memcached.ini" ]]; then
if [[ "$PHPMUVER" != 'NGDEBUG' ]]; then
DETECTMEMCACHED=y
else
# remove memcache.ini & memcached.ini when PHP NGDEBUG detected on upgrade
DETECTMEMCACHED=n
echo "rm -rf ${CONFIGSCANDIR}/memcache.ini"
# echo "rm -rf ${CONFIGSCANDIR}/memcached.ini"
rm -rf "${CONFIGSCANDIR}/memcache.ini"
# rm -rf "${CONFIGSCANDIR}/memcached.ini"
fi
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTMEMCACHED=y
fi
if [[ -f "${CONFIGSCANDIR}/redis.ini" || "$PHPREDIS" = [yY] ]]; then
DETECTREDIS=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTREDIS=y
fi
if [[ -f "${CONFIGSCANDIR}/mongodb.ini" || "$PHPMONGODB" = [yY] ]]; then
DETECTMONGODB=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTMONGODB=y
fi
if [[ -f "${CONFIGSCANDIR}/zopfli.ini" || "$PHPZOPFLI" = [yY] ]]; then
DETECTZOPFLI=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTZOPFLI=y
fi
if [[ -f "${CONFIGSCANDIR}/brotli.ini" || "$PHP_BROTLI" = [yY] ]]; then
DETECTBROTLI=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTBROTLI=y
fi
if [[ -f "${CONFIGSCANDIR}/lz4.ini" || "$PHP_LZFOUR" = [yY] ]]; then
DETECTLZFOUR=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTLZFOUR=y
fi
if [[ -f "${CONFIGSCANDIR}/lzf.ini" || "$PHP_LZF" = [yY] ]]; then
DETECTLZF=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTLZF=y
fi
if [[ -f "${CONFIGSCANDIR}/zstd.ini" || "$PHP_ZSTD" = [yY] ]]; then
DETECTZSTD=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTZSTD=y
fi
if [ -f "${CONFIGSCANDIR}/zendopcache.ini" ]; then
DETECTOPCACHE=y
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTOPCACHE=y
fi
if [ -f "${CONFIGSCANDIR}/mailparse.ini" ]; then
DETECTMAILPARSE=y
if [[ "$PHPMAILPARSE" != [yY] ]]; then
echo "rm -rf ${CONFIGSCANDIR}/mailparse.ini"
rm -rf "${CONFIGSCANDIR}/mailparse.ini"
fi
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTMAILPARSE=y
fi
if [ -f "${CONFIGSCANDIR}/imagick.ini" ]; then
if [[ "$PHPMUVER" != 'NGDEBUG' ]]; then
DETECTIMAGICK=y
else
# remove imagick.ini when PHP NGDEBUG detected on upgrade
DETECTIMAGICK=n
echo "rm -rf ${CONFIGSCANDIR}/imagick.ini"
rm -rf "${CONFIGSCANDIR}/imagick.ini"
fi
if [[ "$PHPIMAGICK" != [yY] ]]; then
echo "rm -rf ${CONFIGSCANDIR}/imagick.ini"
rm -rf "${CONFIGSCANDIR}/imagick.ini"
fi
elif [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
DETECTIMAGICK=y
fi
if [ -f "${CONFIGSCANDIR}/geoip.ini" ]; then
DETECTGEOIP=y
else
DETECTGEOIP=y
fi
}
########################################################################
autodetectinstallextensions() {
PHPEXTDIR_AUTODETECT=$(cat /usr/local/bin/php-config | awk '/^extension_dir/ {extdir=$1} END {gsub(/\047|extension_dir|=|)/,"",extdir); print extdir}')
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "PHP: Auto Detect Previous Extensions"
fi
cecho "----------------------------------------------------" $boldgreen
cecho "Auto reinstalling previously detected PHP extensions" $boldyellow
cecho "----------------------------------------------------" $boldgreen
if [[ "$DETECTMSSQL" = [yY] ]] || [[ "$DETECTMSSQL" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/mssql.so" ]]; then
cecho "Auto reinstalling previously detected PHP mssql extension" $boldyellow
php_mssqlinstall
fi
if [[ "$DETECTXCACHE" = [yY] ]] || [[ "$DETECTXCACHE" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/xcache.so" ]]; then
cecho "Auto reinstalling previously detected Xcache" $boldyellow
funct_xcachereinstall silent
fi
if [[ "$DETECTAPC" = [yY] ]] || [[ "$DETECTAPC" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/apc.so" ]]; then
cecho "Auto reinstalling previously detected APC Cache" $boldyellow
funct_apcreinstall
fi
if [[ "$DETECTIGBINARY" = [yY] ]] || [[ "$DETECTIGBINARY" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/igbinary.so" ]]; then
cecho "Auto reinstalling previously detected igbinary extension" $boldyellow
funct_igbinaryinstall
fi
if [[ "$DETECTMEMCACHED" = [yY] ]] || [[ "$DETECTMEMCACHED" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/memcached.so" ]]; then
cecho "Auto reinstalling previously detected memcached/memcache php extension" $boldyellow
funct_memcachedreinstall
fi
if [[ "$DETECTREDIS" = [yY] ]] || [[ "$DETECTREDIS" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/redis.so" ]]; then
cecho "Auto reinstalling previously detected redis PHP extension" $boldyellow
redisinstall
fi
if [[ "$DETECTMONGODB" = [yY] ]] || [[ "$DETECTMONGODB" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/mongodb.so" ]]; then
cecho "Auto reinstalling previously detected MongoDB PHP extension" $boldyellow
mongodbinstall
fi
if [[ "$DETECTZOPFLI" = [yY] ]] || [[ "$DETECTZOPFLI" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/zopfli.so" ]]; then
cecho "Auto reinstalling previously detected Zopfli PHP extension" $boldyellow
zopfliinstall
fi
if [[ "$DETECTBROTLI" = [yY] ]] || [[ "$DETECTBROTLI" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/brotli.so" ]]; then
cecho "Auto reinstalling previously detected brotli PHP extension" $boldyellow
php_ext_brotli
fi
if [[ "$DETECTLZFOUR" = [yY] ]] || [[ "$DETECTLZFOUR" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/lz4.so" ]]; then
cecho "Auto reinstalling previously detected lz4 PHP extension" $boldyellow
php_ext_lzfour
fi
if [[ "$DETECTLZF" = [yY] ]] || [[ "$DETECTLZF" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/lzf.so" ]]; then
cecho "Auto reinstalling previously detected lzf PHP extension" $boldyellow
php_ext_lzf
fi
if [[ "$DETECTZSTD" = [yY] ]] || [[ "$DETECTZSTD" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/zstd.so" ]]; then
cecho "Auto reinstalling previously detected zstd PHP extension" $boldyellow
php_ext_zstd
fi
if [[ "$DETECTOPCACHE" = [yY] ]]; then
# ZOPCACHE_OVERRIDE=y allows you to override PHP 5.5-7.x's inbuilt included
# Zend Opcache version with one available from pecl site
if [[ "$PHPMUVER" = 5.[234] || "$ZOPCACHE_OVERRIDE" = [yY] ]]; then
cecho "Auto reinstalling previously detected Zend Opcache" $boldyellow
zopcachereinstall
fi
fi
if [[ "$DETECTMAILPARSE" = [yY] ]] || [[ "$DETECTMAILPARSE" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/mailparse.so" ]]; then
cecho "Auto reinstalling previously detected mailparse extension" $boldyellow
mailparseinstall
fi
if [[ "$DETECTIMAGICK" = [yY] ]] || [[ "$DETECTIMAGICK" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/imagick.so" ]]; then
cecho "Auto reinstalling previously detected imagemagick extension" $boldyellow
imagickinstall
fi
if [[ "$DETECTGEOIP" = [yY] ]] || [[ "$DETECTGEOIP" = [yY] && ! -f "$PHPEXTDIR_AUTODETECT/geoip.so" ]]; then
cecho "Auto reinstalling previously detected geoip extension" $boldyellow
geoipphpext
fi
# Fix extension directory on major PHP version changes
# Zend Opcache related when downgrading PHP major versions
PHPEXTDIRDNEW=$(cat /usr/local/bin/php-config | awk '/^extension_dir/ {extdir=$1} END {gsub(/\047|extension_dir|=|)/,"",extdir); print extdir}')
OLD=$(echo $PHPEXTDIRDOLD | sed 's/\//\\\//g')
NEW=$(echo $PHPEXTDIRDNEW | sed 's/\//\\\//g')
for ini in "$(ls ${CONFIGSCANDIR}/ | grep .ini)"
do
echo "$ini"
sed -i "s/$OLD/$NEW/g" "${CONFIGSCANDIR}/${ini}" >/dev/null 2>&1
done
}
########################################################################
funct_phpupgrade() {
axelsetup
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "PHP: Upgrade"
fi
if [ "${MACHINE_TYPE}" == 'x86_64' ];
then
ARCH='x86_64'
else
ARCH='i386'
fi
# Set LIBDIR
if [ "${ARCH}" == 'x86_64' ];
then
LIBDIR='lib64'
else
LIBDIR='lib'
fi
echo " "
if [[ "$UALL" = 'y' ]]; then
key='y'
else
read -ep "PHP Upgrade/Downgrade - Would you like to continue? [y/n] " key
if [[ "$key" = [nN] ]];
then
exit 0
fi
fi # UALL
DIR_TMP="$DIR_TMP"
if [ ! -d "$DIR_TMP" ]; then
mkdir "$DIR_TMP"
fi
funct_mktempfile
if [[ "$UALL" = 'y' ]]; then
phpver=$(php-config --version)
overwritephpfpmconf='n'
lessphpmem='y'
else
echo
echo "----------------------------------------------------------------"
echo "Install which version of PHP? (version i.e. ${PHP_VERSION}, 7.0.33, NGDEBUG)"
echo "PHP 7.x/7.1.x/7.2.x/7.3.x is GA Stable but still may have broken PHP extensions."
echo "NGDEBUG is PHP 7.4.0 dev builds minus incompatible PHP extensions"
echo "----------------------------------------------------------------"
echo
echo "Current PHP Version: $(php -v 2>&1 | head -n1 | cut -d "(" -f1 | awk '{print $2}')"
echo
read -ep "Enter PHP Version number you want to upgrade/downgrade to: " phpver
echo
# validate php version format is 7.3.x and not 7.3
phpver_formatcheck="$(echo "$phpver" | grep '[0-9].[0-9].[0-9]')"
if [[ ! "$phpver_formatcheck" ]]; then
echo
echo "error: invalid php version format entered you entered: $phpver"
echo
echo "correct exact format example is 7.3.7 not 7.3"
echo "latest php versions are listed at https://php.net/"
echo
read -ep "Enter PHP Version number you want to upgrade/downgrade to: " phpver
echo
fi
read -ep "Do you still want to continue? [y/n] " phpfpm_stillcont
if [[ "$phpfpm_stillcont" = [nN] ]];then
exit 0
fi
echo
echo "----------------------------------------------------------------"
echo "existing php.ini will be backed up at /usr/local/lib/php.ini-oldversion_$DT"
# only prompt for php-fpm.conf overwrite if the existing /usr/local/nginx/conf/php.conf file
# differs from the current centmin mod template file
if [[ -f /usr/local/nginx/conf/php.conf && -f "$CUR_DIR/config/nginx/php.conf" ]]; then
diff -u /usr/local/nginx/conf/php.conf "$CUR_DIR/config/nginx/php.conf" &>/dev/null
PHPCONF_DIFFCHECK=$?
else
PHPCONF_DIFFCHECK=1
fi
if [[ "$PHPCONF_DIFFCHECK" != '0' && "$PHP_OVERWRITECONF" = [yY] ]]; then
echo "Want to update to latest php.conf & php-fpm.conf ? (overwrites will auto backup existing files)"
echo "existing php.conf will be backed up to /usr/local/nginx/conf/php.conf-oldversion_$DT"
echo "existing php-fpm.conf will be backed up to /usr/local/etc/php-fpm.conf-oldversion_$DT"
echo "----------------------------------------------------------------"
read -ep "Update & overwrite your existing php.conf & php-fpm.conf [y/n]: " overwritephpfpmconf
echo "----------------------------------------------------------------"
else
echo "----------------------------------------------------------------"
overwritephpfpmconf=n
fi
# switch to auto calculate system memory instead of prompting for user input
IS_PHPLOWMEM='2097152'
CHECK_PHPLOWMEM=$(expr $TOTALMEM \< $IS_PHPLOWMEM)
if [ "$CHECK_PHPLOWMEM" == "1" ]; then
lessphpmem=y
fi
fi # UALL
## grab newer custom written htpasswd.sh as well
gethtpasswdsh
PHPCURRENTVER=$(php -v | awk -F " " '{print $2}' | head -n1 | cut -d . -f1,2)
PHPMUVER=$(echo "$phpver" | cut -d . -f1,2)
PHPMU_ALPHAVER=$(echo "$phpver")
phpng_download
autodetectextensions
zopcacheupgrade
addmysql_legacy
echo "*************************************************"
cecho "* Upgrading PHP" $boldgreen
echo "*************************************************"
# if you set /etc/centminmod/custom_config.inc file to
# PHP_UPDATEMAINTENANCE=y
# then whenever you run php upgrade, you put all sites
# on server into 503 maintenance mode first and once
# updated, disable 503 maintenance mod after
if [[ "$PHP_UPDATEMAINTENANCE" = [yY] ]]; then
if [ -f /usr/bin/sitestatus ]; then
/usr/bin/sitestatus off
fi
fi
funct_centos6check
if [[ "$PHPMUVER" = 5.3 ]]; then
if [ ! -f /usr/bin/autoconf-2.13 ]; then
yum -y -q install autoconf213
fi
export PHP_AUTOCONF=/usr/bin/autoconf-2.13
export PHP_AUTOHEADER=/usr/bin/autoheader-2.13
else
export PHP_AUTOCONF=/usr/bin/autoconf
export PHP_AUTOHEADER=/usr/bin/autoheader
fi
cd "$DIR_TMP"
if [ "$(rpm -qa | grep '^php*' | grep -v 'phonon-backend-gstreamer')" ]; then
# IMPORTANT Erase any PHP installations first, otherwise conflicts may arise
echo "yum -y erase php*"
yum -y erase php*
fi
if [[ "$PHPNG_YES" != [yY] ]]; then
phpgeolocation
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "PHP: Download"
fi
curl -${ipv_forceopt}Is --connect-timeout 5 --max-time 5 "${PHP_MIRRORURL}/distributions/php-${phpver}.tar.${PHPEXTSION}" | grep 'HTTP\/' | grep '404'
PHPGEO_CURLCHECK=$?
curl -${ipv_forceopt}Is --connect-timeout 5 --max-time 5 "${PHP_MIRRORURL}/distributions/php-${phpver}.tar.${PHPEXTSION}" | grep 'HTTP\/' | egrep '200|301|302'
PHPGEO_CURLCHECKOK=$?
# check if download url is 404 not found but also
# check for valid status header 200, 301 or 302
if [[ "$PHPGEO_CURLCHECK" = '0' || "$PHPGEO_CURLCHECKOK" != '0' ]]; then
PHP_MIRRORURL="https://www.php.net"
PHPUPGRADE_MIRRORURL="$PHP_MIRRORURL"
fi
if [ -s "php-${phpver}.tar.${PHPEXTSION}" ]; then
cecho "php ${phpver} Archive found, skipping download..." $boldgreen
else
$DOWNLOADAPP "${PHP_MIRRORURL}/distributions/php-${phpver}.tar.${PHPEXTSION}" $AXELPHPUPGRADETARGZ $WGETRETRY
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: php-${phpver}.tar.${PHPEXTSION} download failed." $boldgreen
checklogdetails
exit
else
cecho "Download done." $boldyellow
echo ""
fi
fi
tar $PHPTAR_FLAGS "php-${phpver}.tar.${PHPEXTSION}"
ERROR=$?
if [[ "$ERROR" != '0' ]]; then
cecho "Error: php-${phpver}.tar.${PHPEXTSION} extraction failed." $boldgreen
checklogdetails
exit
else
cecho "php-${phpver}.tar.${PHPEXTSION} valid file." $boldyellow
echo ""
fi
fi
cd "php-${phpver}"
PHPVER_ID=$(awk '/PHP_VERSION_ID/ {print $3}' ${DIR_TMP}/php-${phpver}/main/php_version.h)
echo "PHP VERSION ID: $PHPVER_ID"
##############################################
# begin update php.ini
echo ""
echo "*************************************************"
cecho "* Updating php.ini... " $boldgreen
echo "*************************************************"
echo "old php.ini will be saved at /usr/local/lib/php.ini-oldversion_$DT"
echo "if you have modified your old php.ini i.e. installed and loaded"
echo "APC, Xcache, Memcache or Suhosin - please re-install them after php upgrade"
echo "..."
\cp -f /usr/local/lib/php.ini /usr/local/lib/php.ini-oldversion_$DT
\cp -f php.ini-production /usr/local/lib/php.ini
chmod 644 /usr/local/lib/php.ini
phpsededit
phptuning
PHPDIFF=$(diff /usr/local/lib/php.ini /usr/local/lib/php.ini-oldversion_$DT)
echo ""
if [ ! -z "$PHPDIFF" ]; then
echo "checking updated php.ini compared to old /usr/local/lib/php.ini-oldversion_$DT"
echo "please note the following differences: "
echo "if APC, Xcache, Memcache, Suhosin or FFMPEG Extensions are listed please re-install them"
echo ""
echo "--------------------------------------------------------------------------------------------"
diff /usr/local/lib/php.ini "/usr/local/lib/php.ini-oldversion_$DT"
echo "--------------------------------------------------------------------------------------------"
echo ""
echo "*************************************************"
echo "Automatically continuing upgrade in 4 seconds..."
echo "*************************************************"
sleep 4
echo ""
fi # PHPDIFF
# end update php.ini
##############################################
make clean
php_patches
if [[ "$CENTOS_SIX" -eq '6' ]]; then
# PHP 7.3.0 + centos 6 issue https://community.centminmod.com/posts/69561/
if [ ! -f /usr/bin/autoconf268 ]; then
echo "yum -q -y install autoconf268"
yum -q -y install autoconf268
fi
if [ -f /usr/bin/autoconf268 ]; then
export PHP_AUTOCONF=/usr/bin/autoconf268
export PHP_AUTOHEADER=/usr/bin/autoheader268
fi
fi
./buildconf --force
if [ ! -d fpm-build ]; then
mkdir fpm-build
fi
cd fpm-build
make clean
#mkdir -p /usr/${LIBDIR}/mysql
#ln -s /usr/${LIBDIR}/libmysqlclient.so /usr/${LIBDIR}/mysql/libmysqlclient.so
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "PHP: Configure"
fi
if [[ "$TIME_PHPCONFIGURE" = [yY] ]]; then
funct_phpconfigure 2>&1 | awk '{ print strftime("%Y-%m-%d %H:%M:%S"), $0; fflush(); }'
else
funct_phpconfigure
fi
################
# error check
ERR=$?
if [ $ERR != 0 ]; then
echo -e "\n`date`\nError: $ERR, PHP configure failed ($SCRIPT_VERSION)\n"
echo "report errors on the forums at community.centminmod.com/forums/8/"
echo "with info asked at community.centminmod.com/threads/17857/"
echo
free -m
echo
df -hT
echo
echo "CPU: $(awk -F ': ' '/^model name/ {print $2}' /proc/cpuinfo | head -n1) ($(grep -c "processor" /proc/cpuinfo))"
echo
echo "version increment history"
tail -5 /etc/centminmod-versionlog
if [ -d "${SCRIPT_DIR}/.git" ]; then
echo
echo "last Centmin Mod local git commit entry"
pushd "${SCRIPT_DIR}"
git log --numstat --pretty="%n%h %an %aD %n%s" --shortstat -1
popd
fi
exit
else
echo -e "\n`date`\nSuccess: PHP configure ok\n"
cmservice php-fpm restart
fi
# error check
################
# separate make threads for PHP compiles
if [ -f /proc/user_beancounters ]; then
# CPUS='1'
# MAKETHREADS_PHP=" -j$CPUS"
# speed up make
CPUS_MAKEPHP=$(grep -c "processor" /proc/cpuinfo)
if [[ "$CPUS_MAKEPHP" -gt '8' ]]; then
CPUS_MAKEPHP=$(echo "$CPUS_MAKEPHP+2" | bc)
elif [[ "$CPUS_MAKEPHP" -eq '8' ]]; then
CPUS_MAKEPHP=$(echo "$CPUS_MAKEPHP+1" | bc)
else
CPUS_MAKEPHP=$(echo "$CPUS_MAKEPHP" | bc)
fi
MAKETHREADS_PHP=" -j$CPUS_MAKEPHP"
else
# speed up make
CPUS_MAKEPHP=$(grep -c "processor" /proc/cpuinfo)
if [[ "$CPUS_MAKEPHP" -gt '8' ]]; then
CPUS_MAKEPHP=$(echo "$CPUS_MAKEPHP+2" | bc)
elif [[ "$CPUS_MAKEPHP" -eq '8' ]]; then
CPUS_MAKEPHP=$(echo "$CPUS_MAKEPHP+1" | bc)
else
CPUS_MAKEPHP=$(echo "$CPUS_MAKEPHP" | bc)
fi
MAKETHREADS_PHP=" -j$CPUS_MAKEPHP"
fi
if [[ "$(grep -c "processor" /proc/cpuinfo)" -lt '2' ]]; then
# Disable PGO if less than 2 cpu threads
PHP_PGO='n'
fi
if [[ "$PHP_PGO_ALWAYS" = [yY] ]]; then
# override above greater than 2 cpu only PHP PGO enabling
# so when PHP_PGO_ALWAYS='y' set, you can even do PHP PGO
# compilations when you have 1 cpu detected
PHP_PGO='y'
fi
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "PHP: Make"
fi
echo "PHPMUVER = $PHPMUVER"
echo "PHP_PGO = $PHP_PGO"
if [[ "$PHP_PGO" = [yY] ]] && [[ "$PHPMUVER" = '7.0' || "$PHPMUVER" = '7.1' || "$PHPMUVER" = '7.2' || "$PHPMUVER" = '7.3' || "$PHPMUVER" = '7.4' ]]; then
echo "make${MAKETHREADS_PHP} prof-gen"
time make${MAKETHREADS_PHP} prof-gen
if [ ! -d "$DIR_TMP/php_pgo_training_scripts" ]; then
pushd "$DIR_TMP"
time git clone https://github.com/01org/php_pgo_training_scripts php_pgo_training_scripts
popd
GET_ROOT_PASS=$(awk -F "=" '/password/ {print $2}' /root/.my.cnf | sed -e "s|'||g")
sed -i "s|define('DB_PASSWORD', 'root');|define('DB_PASSWORD', '$GET_ROOT_PASS');|" "$DIR_TMP/php_pgo_training_scripts/constants.php"
./sapi/cli/php "$DIR_TMP/php_pgo_training_scripts/init.php"
echo "time ./sapi/cgi/php-cgi -T80 ../Zend/bench.php"
time ./sapi/cgi/php-cgi -T80 ../Zend/bench.php
echo "time ./sapi/cgi/php-cgi -T40 ../Zend/micro_bench.php"
time ./sapi/cgi/php-cgi -T40 ../Zend/micro_bench.php
echo "./sapi/cgi/php-cgi -T100 "$DIR_TMP/php_pgo_training_scripts/index.php""
time ./sapi/cgi/php-cgi -T100 "$DIR_TMP/php_pgo_training_scripts/index.php"
if [ -f "$PHPPGO_INDEXPATH" ]; then
echo "./sapi/cgi/php-cgi -T100 "$PHPPGO_INDEXPATH""
time ./sapi/cgi/php-cgi -T100 "$PHPPGO_INDEXPATH"
fi
if [ -f "$PHPPGO_INDEXPATH_TWO" ]; then
echo "./sapi/cgi/php-cgi -T100 "$PHPPGO_INDEXPATH_TWO""
time ./sapi/cgi/php-cgi -T100 "$PHPPGO_INDEXPATH_TWO"
fi
if [ -f "$PHPPGO_INDEXPATH_THREE" ]; then
echo "./sapi/cgi/php-cgi -T100 "$PHPPGO_INDEXPATH_THREE""
time ./sapi/cgi/php-cgi -T100 "$PHPPGO_INDEXPATH_THREE"
fi
if [ -f "$PHPPGO_INDEXPATH_FOUR" ]; then
echo "./sapi/cgi/php-cgi -T100 "$PHPPGO_INDEXPATH_FOUR""
time ./sapi/cgi/php-cgi -T100 "$PHPPGO_INDEXPATH_FOUR"
fi
echo "pgophpbench"
pgophpbench
if [ -f "${DIR_TMP}/phpbench/phpbench.php" ]; then
echo "./sapi/cgi/php-cgi -T10 ${DIR_TMP}/phpbench/phpbench.php"
time ./sapi/cgi/php-cgi -T10 "${DIR_TMP}/phpbench/phpbench.php"
fi
if [ -f /opt/phpbench/detailed_benchmark.php ]; then
echo "./sapi/cgi/php-cgi -T20 /opt/phpbench/detailed_benchmark.php"
time ./sapi/cgi/php-cgi -T20 /opt/phpbench/detailed_benchmark.php
fi
elif [ -d "$DIR_TMP/php_pgo_training_scripts" ]; then
pushd "$DIR_TMP/php_pgo_training_scripts"
git stash
git pull
popd
GET_ROOT_PASS=$(awk -F "=" '/password/ {print $2}' /root/.my.cnf | sed -e "s|'||g")
sed -i "s|define('DB_PASSWORD', 'root');|define('DB_PASSWORD', '$GET_ROOT_PASS');|" "$DIR_TMP/php_pgo_training_scripts/constants.php"
./sapi/cli/php "$DIR_TMP/php_pgo_training_scripts/init.php"
echo "time ./sapi/cgi/php-cgi -T2,${PHP_PGO_TRAINRUNS} ../Zend/bench.php"
time ./sapi/cgi/php-cgi -T2,${PHP_PGO_TRAINRUNS} ../Zend/bench.php
echo "time ./sapi/cgi/php-cgi -T2,${PHP_PGO_TRAINRUNS} ../Zend/micro_bench.php"
time ./sapi/cgi/php-cgi -T2,${PHP_PGO_TRAINRUNS} ../Zend/micro_bench.php
echo "./sapi/cgi/php-cgi -T${PHP_PGO_TRAINRUNS} "$DIR_TMP/php_pgo_training_scripts/index.php""
time ./sapi/cgi/php-cgi -T${PHP_PGO_TRAINRUNS} "$DIR_TMP/php_pgo_training_scripts/index.php"
if [ -f "$PHPPGO_INDEXPATH" ]; then
echo "./sapi/cgi/php-cgi -T80 "$PHPPGO_INDEXPATH""
time ./sapi/cgi/php-cgi -T80 "$PHPPGO_INDEXPATH"
fi
if [ -f "$PHPPGO_INDEXPATH_TWO" ]; then
echo "./sapi/cgi/php-cgi -T80 "$PHPPGO_INDEXPATH_TWO""
time ./sapi/cgi/php-cgi -T80 "$PHPPGO_INDEXPATH_TWO"
fi
if [ -f "$PHPPGO_INDEXPATH_THREE" ]; then
echo "./sapi/cgi/php-cgi -T80 "$PHPPGO_INDEXPATH_THREE""
time ./sapi/cgi/php-cgi -T80 "$PHPPGO_INDEXPATH_THREE"
fi
if [ -f "$PHPPGO_INDEXPATH_FOUR" ]; then
echo "./sapi/cgi/php-cgi -T80 "$PHPPGO_INDEXPATH_FOUR""
time ./sapi/cgi/php-cgi -T80 "$PHPPGO_INDEXPATH_FOUR"
fi
echo "pgophpbench"
pgophpbench
if [ -f "${DIR_TMP}/phpbench/phpbench.php" ]; then
echo "./sapi/cgi/php-cgi -T10 ${DIR_TMP}/phpbench/phpbench.php"
time ./sapi/cgi/php-cgi -T10 "${DIR_TMP}/phpbench/phpbench.php"
fi
if [ -f /opt/phpbench/detailed_benchmark.php ]; then
echo "./sapi/cgi/php-cgi -T20 /opt/phpbench/detailed_benchmark.php"
time ./sapi/cgi/php-cgi -T20 /opt/phpbench/detailed_benchmark.php
fi
fi
echo "make prof-clean"
time make prof-clean
echo "make${MAKETHREADS_PHP} prof-use"
time make${MAKETHREADS_PHP} prof-use
else
echo "make${MAKETHREADS_PHP}"
time make${MAKETHREADS_PHP}
fi
################
# error check
ERR=$?
sar_call
if [ $ERR != 0 ]; then
echo -e "\n`date`\nError: $ERR, PHP make failed ($SCRIPT_VERSION)\n"
free -m
echo
echo "report errors on the forums at community.centminmod.com/forums/8/"
echo "with info asked at community.centminmod.com/threads/17857/"
echo
free -m
echo
df -hT
echo
echo "CPU: $(awk -F ': ' '/^model name/ {print $2}' /proc/cpuinfo | head -n1) ($(grep -c "processor" /proc/cpuinfo))"
echo
echo "version increment history"
tail -5 /etc/centminmod-versionlog
if [ -d "${SCRIPT_DIR}/.git" ]; then
echo
echo "last Centmin Mod local git commit entry"
pushd "${SCRIPT_DIR}"
git log --numstat --pretty="%n%h %an %aD %n%s" --shortstat -1
popd
fi
exit
else
echo -e "\n`date`\nSuccess: PHP make ok\n"
cmservice php-fpm restart
fi
# error check
################
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "PHP: Make Install"
fi
echo "make install"
time make install
if [[ "$STRIPPHP" = [yY] ]]; then
echo
echo "strip PHP binary..."
ls -lah /usr/local/bin/php
ls -lah /usr/local/bin/php-cgi
ls -lah /usr/local/sbin/php-fpm
echo
echo "backup before strip PHP binary..."
\cp -af /usr/local/bin/php /usr/local/bin/php-b4strip
\cp -af /usr/local/bin/php-cgi /usr/local/bin/php-cgi-b4strip
\cp -af /usr/local/sbin/php-fpm /usr/local/sbin/php-fpm-b4strip
strip -s /usr/local/bin/php
strip -s /usr/local/bin/php-cgi
strip -s /usr/local/sbin/php-fpm
echo
echo "after strip PHP binary..."
ls -lah /usr/local/bin/php
ls -lah /usr/local/bin/php-cgi
ls -lah /usr/local/sbin/php-fpm
echo
fi
################
# error check
ERR=$?
sar_call
if [ $ERR != 0 ]; then
echo -e "\n`date`\nError: $ERR, PHP wasn't installed properly ($SCRIPT_VERSION)\n"
echo "report errors on the forums at community.centminmod.com/forums/8/"
echo "with info asked at community.centminmod.com/threads/17857/"
echo
free -m
echo
df -hT
echo
echo "CPU: $(awk -F ': ' '/^model name/ {print $2}' /proc/cpuinfo | head -n1) ($(grep -c "processor" /proc/cpuinfo))"
echo
echo "version increment history"
tail -5 /etc/centminmod-versionlog
if [ -d "${SCRIPT_DIR}/.git" ]; then
echo
echo "last Centmin Mod local git commit entry"
pushd "${SCRIPT_DIR}"
git log --numstat --pretty="%n%h %an %aD %n%s" --shortstat -1
popd
fi
exit
else
echo -e "\n`date`\nSuccess: PHP was installed properly\n"
echo
echo
# set extra cflags fro devtoolset-7 and devtoolset-8 compatibility
enable_devtoolset
# read -ep "Do you want to update to latest php-fpm.conf ? It will overwrite your existing php-fpm.conf [y/n]: " overwritephpfpmconf
if [[ "$overwritephpfpmconf" = [yY] ]]; then
# read -ep "Does this server have less than <=2048MB of memory installed ? [y/n]: " lessphpmem
echo
echo "Backing up existing php-fpm.conf at /usr/local/etc/php-fpm.conf-oldversion_$DT"
echo "If you have made an custom changes to /usr/local/etc/php-fpm.conf, you will find"
echo "they still exist in backup at /usr/local/etc/php-fpm.conf-oldversion_$DT"
cp -f /usr/local/etc/php-fpm.conf "/usr/local/etc/php-fpm.conf-oldversion_$DT"
ls -lhrt /usr/local/etc/ | grep php-fpm.conf
sleep 9
echo
echo "Backing up existing php.conf at /usr/local/nginx/conf/php.conf-oldversion_$DT"
echo "If you have made an custom changes to /usr/local/nginx/conf/php.conf, you will find"
echo "they still exist in backup at /usr/local/nginx/conf/php.conf-oldversion_$DT"
cp -f /usr/local/nginx/conf/php.conf "/usr/local/nginx/conf/php.conf-oldversion_$DT"
ls -lhrt /usr/local/nginx/conf/ | grep php.conf
cp -f "$CUR_DIR/config/nginx/php.conf" /usr/local/nginx/conf/php.conf
# recheck whether fastcgi_param GEOIP_ settings in php.conf need to be disabled or enabled
if [[ "$NGINX_GEOIP" = [yY] ]]; then
sed -i 's/#fastcgi_param GEOIP_/fastcgi_param GEOIP_/' /usr/local/nginx/conf/php.conf
else
sed -i 's/fastcgi_param GEOIP_/#fastcgi_param GEOIP_/' /usr/local/nginx/conf/php.conf
fi
sleep 12
echo
if [[ "$lessphpmem" = [yY] ]]; then
echo "$lessphpmem"
echo -e "\nCopying php-fpm-min.conf /usr/local/etc/php-fpm.conf\n"
cp -f "$CUR_DIR/config/php-fpm/php-fpm-min.conf" /usr/local/etc/php-fpm.conf
else
echo "$lessphpmem"
echo -e "\nCopying php-fpm.conf /usr/local/etc/php-fpm.conf\n"
cp -f "$CUR_DIR/config/php-fpm/php-fpm.conf" /usr/local/etc/php-fpm.conf
fi # lessphpmem
# account for phpmyadmin.sh created php-fpm unix socket pool support
if [ -f /usr/local/nginx/conf/phpfpmd/phpfpm_myadmin.conf ]; then
sed -i 's/;include=\/usr\/local\/nginx\/conf\/phpfpmd\/\*.conf/include=\/usr\/local\/nginx\/conf\/phpfpmd\/\*.conf/g' /usr/local/etc/php-fpm.conf
fi
# only auto reinstall PHP extensions when major PHP upgrade version differs
# from existing installed PHP version
if [[ "$PHPMUVER" != "$PHPCURRENTVER" ]] || [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
PHP_MAJORUPGRADE='y'
autodetectinstallextensions
else
PHP_MAJORUPGRADE='n'
fi
if [[ "$PHPMUVER" != 'NGDEBUG' ]]; then
if [[ ! -f "${CONFIGSCANDIR}/redis.ini" && "$PHPREDIS" = [yY] ]]; then
redisinstall
elif [[ -f "${CONFIGSCANDIR}/redis.ini" && "$PHPREDIS" = [nN] ]]; then
rm -rf "${CONFIGSCANDIR}/redis.ini"
fi
fi
else
# only auto reinstall PHP extensions when major PHP upgrade version differs
# from existing installed PHP version
if [[ "$PHPMUVER" != "$PHPCURRENTVER" ]] || [[ "$AUTODETECPHP_OVERRIDE" = [yY] ]]; then
PHP_MAJORUPGRADE='y'
autodetectinstallextensions
else
PHP_MAJORUPGRADE='n'
fi
if [[ "$PHPMUVER" != 'NGDEBUG' ]]; then
if [[ ! -f "${CONFIGSCANDIR}/redis.ini" && "$PHPREDIS" = [yY] ]]; then
redisinstall
elif [[ -f "${CONFIGSCANDIR}/redis.ini" && "$PHPREDIS" = [nN] ]]; then
rm -rf "${CONFIGSCANDIR}/redis.ini"
fi
fi
fi # overwritephpfpmconf
zendopcacheextfix
if [ ! -f "${CONFIGSCANDIR}/geoip.ini" ]; then
# always install geoip module
if [[ "$PHPGEOIP_ALWAYS" = [yY] && "$PHP_MAJORUPGRADE" = [nN] ]]; then
geoipphpext
fi
elif [ -f "${CONFIGSCANDIR}/geoip.ini" ]; then
if [[ "$PHPGEOIP_ALWAYS" = [nN] ]]; then
rm -rf "${CONFIGSCANDIR}/geoip.ini"
elif [[ "$PHPGEOIP_ALWAYS" = [yY] && "$PHP_MAJORUPGRADE" = [nN] ]]; then
geoipphpext
fi
fi
if [ ! -f "${CONFIGSCANDIR}/imagick.ini" ]; then
# always install imagemagick module
if [[ "$PHPIMAGICK_ALWAYS" = [yY] && "$PHP_MAJORUPGRADE" = [nN] ]]; then
imagickinstall
fi
elif [ -f "${CONFIGSCANDIR}/imagick.ini" ]; then
if [[ "$PHPIMAGICK_ALWAYS" = [nN] ]]; then
rm -rf "${CONFIGSCANDIR}/imagick.ini"
elif [[ "$PHPIMAGICK_ALWAYS" = [yY] && "$PHP_MAJORUPGRADE" = [nN] ]]; then
imagickinstall
fi
fi
if [[ ! -f "${CONFIGSCANDIR}/mailparse.ini" && "$PHPMAILPARSE" = [yY] ]]; then
# install mailparse if PHPMAILPARSE=y
mailparseinstall
fi
if [[ "$PHPMONGODB" = [nN] ]]; then
if [ -f "${CONFIGSCANDIR}/mongodb.ini" ]; then
rm -rf "${CONFIGSCANDIR}/mongodb.ini"
fi
fi
if [ ! -f "${CONFIGSCANDIR}/zopfli.ini" ]; then
# always install zopfli module
if [[ "$PHPZOPFLI_ALWAYS" = [yY] && "$PHP_MAJORUPGRADE" = [nN] ]]; then
zopfliinstall
fi
elif [ -f "${CONFIGSCANDIR}/zopfli.ini" ]; then
if [[ "$PHPZOPFLI_ALWAYS" = [nN] ]]; then
rm -rf "${CONFIGSCANDIR}/zopfli.ini"
elif [[ "$PHPZOPFLI_ALWAYS" = [yY] && "$PHP_MAJORUPGRADE" = [nN] ]]; then
zopfliinstall
fi
fi
if [[ "$PHP_BROTLI" = [nN] ]]; then
if [ -f "${CONFIGSCANDIR}/brotli.ini" ]; then
rm -rf "${CONFIGSCANDIR}/brotli.ini"
fi
fi
if [[ "$PHP_LZFOUR" = [nN] ]]; then
if [ -f "${CONFIGSCANDIR}/lz4.ini" ]; then
rm -rf "${CONFIGSCANDIR}/lz4.ini"
fi
fi
if [[ "$PHP_LZF" = [nN] ]]; then
if [ -f "${CONFIGSCANDIR}/lzf.ini" ]; then
rm -rf "${CONFIGSCANDIR}/lzf.ini"
fi
fi
if [[ "$PHP_ZSTD" = [nN] ]]; then
if [ -f "${CONFIGSCANDIR}/zstd.ini" ]; then
rm -rf "${CONFIGSCANDIR}/zstd.ini"
fi
fi
if [[ "$PHP_MEMCACHE" = [nN] ]]; then
if [ -f "${CONFIGSCANDIR}/memcache.ini" ]; then
rm -rf "${CONFIGSCANDIR}/memcache.ini"
fi
fi
if [[ "$PHP_MEMCACHED" = [nN] ]]; then
if [ -f "${CONFIGSCANDIR}/memcached.ini" ]; then
rm -rf "${CONFIGSCANDIR}/memcached.ini"
fi
fi
if [ ! -f "${CONFIGSCANDIR}/mssql.ini" ]; then
# always install mssql module
if [[ "$PHPMSSQL_ALWAYS" = [yY] ]]; then
php_mssqlinstall
fi
elif [ -f "${CONFIGSCANDIR}/mssql.ini" ]; then
if [[ "$PHPMSSQL_ALWAYS" = [nN] ]]; then
rm -rf "${CONFIGSCANDIR}/mssql.ini"
fi
fi
if [[ "$PHPMSSQL" = [nN] ]]; then
if [ -f "${CONFIGSCANDIR}/mssql.ini" ]; then
rm -rf "${CONFIGSCANDIR}/mssql.ini"
fi
fi
if [[ "$PHPIONCUBE" = [yY] ]]; then
if [ -f "$(which figlet)" ]; then
figlet -ckf standard "Install IonCube Loader"