Compare commits

..

7 Commits

View File

@@ -19,7 +19,7 @@ _HTTPD_USER=www-data
_srcdir=$(dirname $(realpath $0))
_pwd=`pwd`
CUR_PWD="$(pwd)"
cert_URL_php_net="https://curl.haxx.se/ca/cacert.pem"
_default_cert_file=""
@@ -259,59 +259,106 @@ _required_base_packages=""
_required_compiler_packages=""
_required_extension_packages=""
# - PHP Extension imagick, geoip, memcached
# -
# - PHP Extension imagick, geoip, memcached, imap
# -
_required_extension_packages="$_required_extension_packages
libmagickwand-dev libmagickcore-dev
libgeoip1 libgeoip-dev geoip-bin
geoip-bin
libgeoip1
libgeoip-dev
libmagickcore-dev
libmagickwand-dev
libmemcached-dev"
# - Compile stuff
# -
_required_compiler_packages="$_required_compiler_packages
g++ g++-multilib gcc gcc-multilib cpp
make automake autoconf libtool flex bison
gettext pkg-config gnu-standards
libssl-dev libreadline-dev libncurses-dev"
autoconf
automake
bison
cpp
flex
g++
g++-multilib
gcc
gcc-multilib
gettext
gnu-standards
libc6-dev
libcrypt-dev
libncurses-dev
libpam0g-dev
libreadline-dev
libssl-dev
libtool
make
pkg-config"
# - Needed to build apache webserver with php/ruby support
# -
_required_base_packages="$_required_base_packages
libxml2 libxml2-dev
curl libcurl4-openssl-dev
libqdbm-dev libgdbm-dev libpspell-dev
libjpeg-dev libxpm-dev libfreetype6-dev
libwmf-dev libtiff-dev libpaper-dev
libmagic-dev
libmagick-dev libgraphics-magick-perl
libgraphicsmagick++1-dev libgraphicsmagick1-dev
libgraphviz-dev libgsf-1-dev libilmbase-dev
libvpx-dev vpx-tools
libgpm-dev libkpathsea-dev libopenexr-dev librsvg2-dev libdjvulibre-dev
libatm-dev libexpat-dev
imagemagick graphicsmagick
curl
exif libexiv2-dev
graphicsmagick
imagemagick
libapr1-dev
libaprutil1-dev
libatm-dev
libcrypto++-dev
libcurl4-openssl-dev
libdjvulibre-dev
libexpat-dev
libfreetype6-dev
libgdbm-dev
libgmp-dev
libgpm-dev
libgraphicsmagick++1-dev
libgraphicsmagick1-dev
libgraphics-magick-perl
libgraphviz-dev
libgsf-1-dev
libharfbuzz-dev
libicu-dev
libilmbase-dev
libjpeg-dev
libkpathsea-dev
libkrb5-dev
libldap-dev
liblua5.1-0
liblua5.1-0-dev
libmagic-dev
libmagick-dev
libmcrypt-dev
libmhash-dev
libmm-dev
libncurses-dev
libnetpbm-dev
libopenexr-dev
libpaper-dev
libpq-dev
libpspell-dev
libqdbm-dev
libreadline-dev
librsvg2-dev
libsctp-dev
libsodium-dev
libtidy-dev
libtiff-dev
libvpx-dev
libwebp-dev
libwmf-dev
libxml2
libxml2-dev
libxmlrpc-epi-dev
libxpm-dev
libxslt1-dev
libzip-dev
mcrypt
netpbm
postgresql-client
re2c
sqlite3
exif libexiv2-dev
netpbm
libnetpbm-dev
libmcrypt-dev mcrypt
libwebp-dev
libpq-dev postgresql-client
libreadline-dev libncurses-dev
libxslt1-dev
libicu-dev
libtidy-dev
libmm-dev libgmp-dev libkrb5-dev libldap-dev
libmhash-dev
libapr1-dev libaprutil1-dev
liblua5.1-0 liblua5.1-0-dev
libsctp-dev
libcrypto++-dev
libzip-dev
libharfbuzz-dev
libsodium-dev
libxmlrpc-epi-dev"
vpx-tools"
# libcroco3-dev
@@ -322,7 +369,7 @@ if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 13 ]] ; then
libc-client-dev"
fi
# Package libpcre3-dev is not availabl at debian 13, but libpcre2-dev is
# Package libpcre3-dev is not availabl at debian 13, but libpcre2-dev is
# available there.
#
if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 13 ]] ; then
@@ -332,7 +379,7 @@ else
_required_base_packages="$_required_base_packages
libpcre2-dev"
fi
# - Package libgraphicsmagick++3 is not available at ubunru 18.04"
# -
@@ -960,7 +1007,7 @@ if $WITH_PHP_FPM_SUPPORT ; then
# Get existing FPM pool definitions
#
for _file in $(ls "/usr/local/php-${PHP_MAIN_VERSION}/etc/fpm.d/") ; do
for _file in $(ls "/usr/local/php-${PHP_MAIN_VERSION}/etc/fpm.d/") ; do
[[ "${_file}" =~ conf$ ]] || continue
[[ "${_file}" = "www-${PHP_MAIN_VERSION}.php-fpm.conf" ]] && continue
php_fpm_pool_definition_file_arr+=("${_file}")
@@ -1310,7 +1357,7 @@ echo ""
echo ""
echo -e "Set value for Parameter \033[32m${_key}\033[m (int)"
echo ""
echo " How often to check script timestamps for updates, in seconds."
echo " How often to check script timestamps for updates, in seconds."
echo " 0 will result in OPcache checking for updates on every request."
echo ""
echo " This configuration directive is ignored if opcache.validate_timestamps"
@@ -1345,7 +1392,7 @@ echo ""
echo ""
echo -e "Set value for Parameter \033[32m${_key}\033[m (bool)"
echo ""
echo " If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds."
echo " If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds."
echo " When this directive is disabled, you must reset OPcache manually via opcache_reset(),"
echo " opcache_invalidate() or by restarting the Web server for changes to the filesystem"
echo " to take effect."
@@ -1396,7 +1443,7 @@ echo ""
echo ""
echo -e "Set value for Parameter \033[32m${_key}\033[m (bool)"
echo ""
echo " If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds."
echo " If enabled, OPcache will check for updated scripts every opcache.revalidate_freq seconds."
echo " When this directive is disabled, you must reset OPcache manually via opcache_reset(),"
echo " opcache_invalidate() or by restarting the Web server for changes to the filesystem"
echo " to take effect."
@@ -1491,13 +1538,13 @@ echo ""
echononl "Eingabe: "
while [[ -z "$_CHOOSE" ]]; do
read OPTION
[[ -z "$OPTION" ]] && OPTION=$__higlighted
[[ -z "$OPTION" ]] && OPTION=$__higlighted
case $OPTION in
1)
1)
_CHOOSE=1
OPCACHE_ERROR_LOG="/var/log/apache2/opcache_errors.log"
;;
2)
2)
_CHOOSE=2
OPCACHE_ERROR_LOG="/var/log/nginx/opcache_errors.log"
;;
@@ -1872,7 +1919,7 @@ fi
echo ""
if [ ! -h /usr/local/php-${PHP_MAIN_VERSION} ] ; then
SYMLINK_PHP_MAIN_VERSION=true
SYMLINK_PHP_MAIN_VERSION=true
echo "Symlink /usr/local/php-$PHP_MAIN_VERSION -> `basename $PREFIX_PHP` will be set."
else
OK=""
@@ -1961,7 +2008,7 @@ FPM_DEFAULT_POOL_ACCESS_FORMAT="\"%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo
FPM_ULIMIT_MAX_FILES=`su -c "ulimit -H -n" -s /bin/bash $_PHP_FPM_USER`
echo ""
@@ -2301,7 +2348,7 @@ if $WITH_PHP_FPM_SUPPORT ; then
echo " $(basename "$_file")"
done
fi
echo ""
echo "PHP FPM Pool Definitions (php-fpm.conf or included files)"
echo " pm.start_servers..................: $FPM_POOL_START_SERVER"
@@ -2332,7 +2379,7 @@ if $SYMLINK_PHP_MAIN_VERSION -o $SYMLINK_PHP ; then
echo " /usr/local/php -> /usr/local/php-$PHP_MAIN_VERSION"
fi
if $SYMLINK_PHP_MAIN_VERSION ; then
echo " /usr/local/php-$PHP_MAIN_VERSION -> `basename $PREFIX_PHP`"
echo " /usr/local/php-$PHP_MAIN_VERSION -> `basename $PREFIX_PHP`"
fi
fi
echo ""
@@ -2405,7 +2452,7 @@ if $WITH_PHP_FPM_SUPPORT ; then
if [[ -n "$(ls $PREFIX_PHP.${_backup_date}/etc/fpm.d/*.conf 2>/dev/null)" ]]; then
for _file in $(ls $PREFIX_PHP.${_backup_date}/etc/fpm.d/*.conf) ; do
if [[ "$(basename "$_file")" = "${FPM_DEFAULT_POOL}.php-fpm.conf" ]]; then
if [[ "$(basename "$_file")" = "${FPM_DEFAULT_POOL}.php-fpm.conf" ]]; then
FPM_DEFAULT_POOL_DEFINITION_EXISTS=true
fi
existing_fpm_definition_arr+=("$(realpath "$_file")")
@@ -2416,7 +2463,7 @@ if $WITH_PHP_FPM_SUPPORT ; then
elif [[ -n "$(ls /usr/local/php-${PHP_MAIN_VERSION}/etc/fpm.d/*.conf 2>/dev/null)" ]]; then
for _file in $(ls /usr/local/php-${PHP_MAIN_VERSION}/etc/fpm.d/*.conf) ; do
if [[ "$(basename "$_file")" = "${FPM_DEFAULT_POOL}.php-fpm.conf" ]]; then
if [[ "$(basename "$_file")" = "${FPM_DEFAULT_POOL}.php-fpm.conf" ]]; then
FPM_DEFAULT_POOL_DEFINITION_EXISTS=true
fi
existing_fpm_definition_arr+=("$(realpath "$_file")")
@@ -2632,7 +2679,7 @@ if $_install_freetype && [[ ! -d /usr/local/freetype-$FREETYPE_VERSION ]]; then
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
echononl "\tGoing to compile freetype-$FREETYPE_VERSION .."
make > ${_logdir}/freetype-make.log 2>&1
if [ "$?" = "0" ]; then
@@ -2851,7 +2898,7 @@ if $_install_icu4c && [[ ! -d /usr/local/icu4c-$ICU4C_VERSION ]]; then
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
echononl "\tGoing to compile icu4c-$ICU4C_VERSION .."
make > ${_logdir}/icu4c-make.log 2>&1
if [ "$?" = "0" ]; then
@@ -3113,7 +3160,7 @@ if $_install_python2 && [[ ! -d /usr/local/python-$PYTHON2_VERSION ]]; then
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
echononl "\tGoing to compile python v${PYTHON2_VERSION} .."
make > ${_logdir}/python2-make.log 2>&1
if [ "$?" = "0" ]; then
@@ -3335,7 +3382,7 @@ if $_install_libxml2 && [[ ! -d /usr/local/libxml2-$LIBXML2_VERSION ]]; then
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
echononl "\tGoing to compile libxml2-$LIBXML2_VERSION .."
make > ${_logdir}/libxml2-make.log 2>&1
if [ "$?" = "0" ]; then
@@ -3438,7 +3485,7 @@ if $_install_openssl1 && [[ ! -d /usr/local/openssl-$OPENSSL1_VERSION ]]; then
_NAME="openssl"
_VERSION="${OPENSSL1_VERSION}"
_archive_file="openssl-${_VERSION}.tgz"
_download_url="https://www.openssl.org/source/openssl-${_VERSION}.tar.gz"
@@ -3588,7 +3635,7 @@ if $_install_openssl1 && [[ ! -d /usr/local/openssl-$OPENSSL1_VERSION ]]; then
fi
fi
echononl "\tGoing to compile ${_NAME} ${_VERSION} .."
make > ${_logdir}/${_NAME}-make.log 2>&1
if [ "$?" = "0" ]; then
@@ -3678,7 +3725,7 @@ fi
## - Set Symlink
## - Set Symlink
## - /usr/include/x86_64-linux-gnu/gmp.h -> /usr/include/gmp.h
## - if not exists
## -
@@ -3694,7 +3741,7 @@ if [ -f "/usr/include/x86_64-linux-gnu/gmp.h" -a ! -e "/usr/include/gmp.h" ]; th
echo ""
fi
## - Set Symlink
## - Set Symlink
## - /usr/lib/x86_64-linux-gnu/libldap.so -> /usr/lib/libldap.so
## - if not exists
## -
@@ -3710,7 +3757,7 @@ if [ -f "/usr/lib/x86_64-linux-gnu/libldap.so" -a ! -e "/usr/lib/libldap.so" ];
echo ""
fi
## - Set Symlink
## - Set Symlink
## - /usr/lib/x86_64-linux-gnu/libXpm.so -> /usr/lib/libXpm.so
## - if not exists
## -
@@ -3726,7 +3773,7 @@ if [ -f "/usr/lib/x86_64-linux-gnu/libXpm.so" -a ! -e "/usr/lib/libXpm.so" ]; th
echo ""
fi
## - Set Symlink
## - Set Symlink
## - /usr/include/x86_64-linux-gnu/curl -> /usr/include/curl
## - if not exists
## -
@@ -3899,7 +3946,7 @@ if [ ! -f ${_srcdir}/php-$VERSION.tar.bz2 ]; then
[[ $OK = "yes" ]] || fatal "Interupted by user"
fi
fi
fi
else
echo_failed
error "Cannot add certificates to ca-certificates file."
@@ -3964,7 +4011,7 @@ if [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]] && [[ $PHP_MAJOR_VER
fatal "Can't find patchfile '${_srcdir}/PHP-7.4-OpenSSL-3.0-compatibility.patch'"
fi
elif [[ "$os_dist" = "debian" ]] && [[ $os_version -gt 11 ]] && ([[ $PHP_MAJOR_VERSION -eq 8 ]] \
&& [[ $PHP_MINOR_VERSION -eq 0 ]]); then
&& [[ $PHP_MINOR_VERSION -eq 0 ]]); then
if [[ -f ${_srcdir}/PHP-8.0-OpenSSL-3.0-compatibility.patch ]] ; then
patch -d $_builddir/ext -p 0 < ${_srcdir}/PHP-8.0-OpenSSL-3.0-compatibility.patch > $tmp_err_msg 2>&1
if [[ $? -eq 0 ]]; then
@@ -3998,7 +4045,7 @@ cd $_builddir || exit 1
echononl "\tGoing to configure.."
# : ${_arch:=i686}
# : ${_arch:=athlon}
# : ${_arch:=athlon}
# : ${_arch:=k8} ## --> x86-64 instructionset
##_cflags="-O2 -march=$_arch "
@@ -4103,7 +4150,7 @@ else
--with-jpeg-dir
--with-xpm-dir
--enable-zip
--enable-wddx
--enable-wddx
"
if [[ "$os_dist" = "debian" ]] && [[ $os_version -lt 10 ]] ; then
config_params="$config_params
@@ -4137,9 +4184,9 @@ if $SYSTEMD_EXISTS ; then
fi
## - since version 7.0: unrecognized options --with-t1lib
## -
## - '--with-webp-dir=DIR' has to be added, i.e. support for libvpx
## - '--with-vpx-dir') has been removed in favor of libwebp.
## -
## - '--with-webp-dir=DIR' has to be added, i.e. support for libvpx
## - '--with-vpx-dir') has been removed in favor of libwebp.
## -
if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
config_params="$config_params
@@ -4229,7 +4276,7 @@ fi
## --with-memcache \
## --with-xml \
echononl "\tGoing to compile.."
make > ${_logdir}/php-make.log 2>&1
if [ "$?" = "0" ]; then
@@ -4314,7 +4361,7 @@ if [[ "${FPM_RUN_DIR}" =~ ^/run/ ]] ; then
# systemd tmpfile settings for php fpm
d $FPM_RUN_DIR 0755 $FPM_DEFAULT_POOL_USER $FPM_DEFAULT_POOL_GROUP -
EOF" >> ${_logdir}/main.log
cat <<EOF > /etc/tmpfiles.d/php-fpm.conf
cat <<EOF > /etc/tmpfiles.d/php-fpm.conf
# systemd tmpfile settings for php fpm
d $FPM_RUN_DIR 0755 $FPM_DEFAULT_POOL_USER $FPM_DEFAULT_POOL_GROUP -
EOF
@@ -4373,7 +4420,7 @@ if ! $WITHOUT_APACHE_MOD_PHP ; then
echo_failed
fi
fi
fi
@@ -4686,7 +4733,7 @@ if $WITH_PHP_FPM_SUPPORT ; then
error "Removing $FPM_INIT_SCRIPT failed!"
fi
fi
echononl "\tSet Symlink $FPM_INIT_SCRIPT --> ${PREFIX_PHP}/sbin/php-${PHP_VERSION_STRING}-fpm"
ln -s ${PREFIX_PHP}/sbin/php-${PHP_VERSION_STRING}-fpm $FPM_INIT_SCRIPT > /dev/null 2<&1
if [ "$?" = "0" ]; then
@@ -4697,7 +4744,7 @@ if $WITH_PHP_FPM_SUPPORT ; then
fi
echononl "\tMake php-${PHP_MAIN_VERSION}-fpm start at boottime"
if ! grep -e "$FPM_INIT_SCRIPT" /etc/rc.local > /dev/null 2>&1 ; then
if ! grep -e "$FPM_INIT_SCRIPT" /etc/rc.local > /dev/null 2>&1 ; then
sed -i -r -e "s#^([[:space:]]*exit\ +.*)#sleep 2\n$FPM_INIT_SCRIPT restart > /dev/null || /bin/true\n\n\1#" /etc/rc.local
if [ "$?" = "0" ]; then
echo_ok
@@ -5251,11 +5298,11 @@ EOF
# - Copy PHP FPM definitions from current installation to the new one.
# -
if [[ ${#existing_fpm_definition_arr[@]} -gt 0 ]] ; then
echo ""
for _file in "${existing_fpm_definition_arr[@]}" ; do
echononl "\tTake existing PHP FPM definition '$(basename "$_file")' .."
cp "$_file" "${PREFIX_PHP}/etc/${FPM_POOL_CONF_DIR}/" > /dev/null 2>&1
cp "$_file" "${PREFIX_PHP}/etc/${FPM_POOL_CONF_DIR}/" > /dev/null 2>&1
if [ "$?" = "0" ]; then
echo_ok
else
@@ -5291,7 +5338,7 @@ EOF
else
echo_failed
fi
key="pm.min_spare_servers"
value="$FPM_POOL_MIN_SPARE"
echononl "\tPHP FPM Pool - Set Definition '${key}'.."
@@ -5942,7 +5989,7 @@ if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
echo_failed
error "See log file: ${_logdir}/pecl_install.log"
fi
else
echo "" >> ${_logdir}/pecl_install.log
@@ -6320,7 +6367,7 @@ if [[ -z "$_MagickWand_config" ]] || [[ ! -f "$(realpath "$_MagickWand_config")"
echo "# ---" >> ${_logdir}/pecl_install.log
echo "# Warning: Cannot find \"MagickWand_config\" - but is needed for \"imagick\"." >> ${_logdir}/pecl_install.log
echo "# ---" >> ${_logdir}/pecl_install.log
fi
echo "" >> ${_logdir}/pecl_install.log
fi
@@ -6359,7 +6406,7 @@ else
_failed=false
echononl "\tInstalling git .."
if ! dpkg -l git 2> /dev/null | grep -e "^ii" | grep git > /dev/null 2>&1 ; then
echo "" >> ${_logdir}/pecl_install.log
echo "# Installing git .." >> ${_logdir}/pecl_install.log
echo "apt-get -q -y install git" >> ${_logdir}/pecl_install.log
@@ -6612,7 +6659,7 @@ if ([[ "$PHP_MAJOR_VERSION" -eq 7 ]] && [[ "$PHP_MINOR_VERSION" -ge 2 ]]) \
else
echo_skipped
fi
fi
@@ -6908,7 +6955,7 @@ if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
else
echo_failed
fi
else
printf "\n" | ${PREFIX_PHP}/bin/pecl install raphf >> "${_logdir}/pecl_install.log" 2>&1
if [ "$?" = "0" ]; then
@@ -6949,35 +6996,322 @@ echononl "\tInstall 'imap' via pecl.."
if ([[ "$PHP_MAJOR_VERSION" -eq 8 ]] && [[ "$PHP_MINOR_VERSION" -ge 4 ]]) \
|| [[ "$PHP_MAJOR_VERSION" -gt 8 ]] \
|| [[ "$os_dist" = "debian" ]] && [[ "$os_version" -ge 13 ]] ; then
printf "\n" | ${PREFIX_PHP}/bin/pecl install imap >> "${_logdir}/pecl_install.log" 2>&1
if [ "$?" = "0" ]; then
echo_ok
|| ([[ "$os_dist" = "debian" ]] && [[ "$os_version" -ge 13 ]]) ; then
if dpkg -s libc-client-dev > /dev/null 2>&1 \
|| dpkg -s libc-client2007e-dev > /dev/null 2>&1 \
|| dpkg -s libc-client2007f-dev > /dev/null 2>&1 \
|| dpkg -s uw-imap-dev >/dev/null 2>&1; then
export CPPFLAGS="-I/usr/include"
export LDFLAGS="-L/usr/lib"
printf "no\nyes\n" | pecl install imap >> "${_logdir}/pecl_install.log" 2>&1
echononl "\tphp.ini: extension=imap .."
_extension="imap.so"
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [ "$?" = "0" ]; then
echo_ok
echononl "\tphp.ini: extension=imap .."
_extension="imap.so"
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
else
echo_failed
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
fi
elif [[ -f "/usr/local/imap/lib/libc-client.a" ]] ; then
_failed=false
echo_skipped
echo -e "\tTry to install imap from source.."
cd /tmp
rm -rf /tmp/imap-*
echo "" >> ${_logdir}/pecl_install.log
echo "# Try to install imap from source.." >> ${_logdir}/pecl_install.log
echo "cd /tmp" >> ${_logdir}/pecl_install.log
echo "rm -rf /tmp/imap-*" >> ${_logdir}/pecl_install.log
# Download imap archive
echononl "\t Download imap source (pecl download imap).."
echo "" >> ${_logdir}/pecl_install.log
echo "# Download imap source .." >> ${_logdir}/pecl_install.log
echo "pecl download imap" >> ${_logdir}/pecl_install.log
pecl download imap > /dev/null 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
_failed=true
fi
# Unzip imap source archive
if ! ${_failed} ; then
echononl "\t Unzip imap source archive .."
echo "" >> ${_logdir}/pecl_install.log
echo "# Unzip imap source archiv .." >> ${_logdir}/pecl_install.log
echo "tar xzf imap-*.tgz " >> ${_logdir}/pecl_install.log
tar xzf imap-*.tgz >> ${_logdir}/pecl_install.log
if [[ $? -eq 0 ]]; then
echo_ok
echo " cd imap-*/" >> ${_logdir}/pecl_install.log
cd imap-*/ >> ${_logdir}/pecl_install.log
if [[ $? -gt 0 ]]; then
error "Error changing directory.."
echo ""
echo "command was: cd imap-*/"
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
_failed=true
fi
else
echo_failed
echo ""
echo "command was: tar xzf imap-*.tgz"
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
_failed=true
fi
fi
# phpize
if ! ${_failed} ; then
echononl "\t Prepare for building extension imap: phpize .."
echo "" >> ${_logdir}/pecl_install.log
echo "# Prepare for building extension imap: phpize .." >> ${_logdir}/pecl_install.log
echo "/usr/local/php-${VERSION}/bin/phpize " >> ${_logdir}/pecl_install.log
/usr/local/php-${VERSION}/bin/phpize >> ${_logdir}/pecl_install.log 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
echo ""
echo "command was: /usr/local/php-${VERSION}/bin/phpize"
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
_failed=true
fi
fi
# Configure..
if ! ${_failed} ; then
echononl "\t Configure imap extension.. .."
echo "" >> ${_logdir}/pecl_install.log
echo "# Configure imap extension .." >> ${_logdir}/pecl_install.log
cat <<EOF >> ${_logdir}/pecl_install.log
export CPPFLAGS="-I/usr/local/imap/include"
export LDFLAGS="-L/usr/local/imap/lib"
./configure \
--with-php-config=/usr/local/php-${VERSION}/bin/php-config \
--with-imap=/usr/local/imap \
--with-kerberos \
--with-imap-ssl
EOF
export CPPFLAGS="-I/usr/local/imap/include"
export LDFLAGS="-L/usr/local/imap/lib"
./configure \
--with-php-config=/usr/local/php-${VERSION}/bin/php-config \
--with-imap=/usr/local/imap \
--with-kerberos \
--with-imap-ssl >> ${_logdir}/pecl_install.log 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
echo ""
echo "command was: ./configure .."
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
_failed=true
fi
fi
if ! ${_failed} ; then
echononl "\t make.."
echo "" >> ${_logdir}/pecl_install.log
echo "# make .." >> ${_logdir}/pecl_install.log
echo "make -j\"$(nproc)\"" >> ${_logdir}/pecl_install.log
make -j"$(nproc)" >> ${_logdir}/pecl_install.log 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
echo ""
echo "command was: make -j\"$(nproc)\""
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
_failed=true
fi
fi
if ! ${_failed} ; then
echononl "\t make install.."
echo "" >> ${_logdir}/pecl_install.log
echo "# make install .." >> ${_logdir}/pecl_install.log
echo "make install" >> ${_logdir}/pecl_install.log
make install >> ${_logdir}/pecl_install.log 2>&1
if [[ $? -eq 0 ]]; then
echo_ok
else
echo_failed
echo ""
echo "command was: make install"
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
_failed=true
fi
fi
rm -rf /tmp/imap-*
if ! $_failed ; then
echononl "\tphp.ini: extension=propro .."
_extension="imap.so"
echo "" >> ${_logdir}/pecl_install.log
echo "# php.ini: extension=${_extension} .." >> ${_logdir}/pecl_install.log
echo "perl -i -n -p -e \"s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#\" $PHP_INI_FILE" >> ${_logdir}/pecl_install.log
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
if [ "$?" = "0" ]; then
echo_ok
else
echo_failed
fi
echo ""
fi
else
echo_failed
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/nno]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Abbruch durch User"
echo ""
echo_skipped
warn "The imap plugin cannot be installed - no imap library was found. "
fi
else
echo_skipped
fi
@@ -7019,7 +7353,7 @@ if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
else
echo_failed
fi
else
echo "printf \"\\n\" | ${PREFIX_PHP}/bin/pecl install propro" >> ${_logdir}/pecl_install.log
@@ -7057,7 +7391,7 @@ else
_failed=false
echononl "\tInstalling git .."
if ! dpkg -l git 2> /dev/null | grep -e "^ii" | grep git > /dev/null 2>&1 ; then
echo "" >> ${_logdir}/pecl_install.log
echo "# Installing git .." >> ${_logdir}/pecl_install.log
echo "apt-get -q -y install git" >> ${_logdir}/pecl_install.log
@@ -7223,7 +7557,7 @@ else
_extension="propro.so"
echo "" >> ${_logdir}/pecl_install.log
echo "# php.ini: extension=memcsched .." >> ${_logdir}/pecl_install.log
echo "# php.ini: extension=${_extension} .." >> ${_logdir}/pecl_install.log
echo "perl -i -n -p -e \"s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#\" $PHP_INI_FILE" >> ${_logdir}/pecl_install.log
perl -i -n -p -e "s#^(\s*\[PHP\]\s*)#\1\nextension=${_extension}\n#" $PHP_INI_FILE
@@ -7273,7 +7607,7 @@ if [[ $PHP_MAJOR_VERSION -lt 7 ]] ; then
else
echo_failed
fi
elif [[ $PHP_MAJOR_VERSION -lt 8 ]] ; then
elif [[ $PHP_MAJOR_VERSION -lt 8 ]] ; then
printf "\n" | ${PREFIX_PHP}/bin/pecl install pecl_http-3.2.4 >> "${_logdir}/pecl_install.log" 2>&1
if [ "$?" = "0" ]; then
echo_ok
@@ -7517,7 +7851,7 @@ else
echo_failed
fi
info "Enable xdebug extension by commenting in the apropriate line at top of php.ini file"
info "Enable xdebug extension by commenting in the apropriate line at top of php.ini file"
## -----
## - END: Install xdebug
@@ -7534,6 +7868,54 @@ echo ""
> ${_logdir}/pear_install.log
echo "" >> ${_logdir}/pear_install.log
echo "# - Change into TMP dir '/tmp'" >> ${_logdir}/pear_install.log
echo "# -" >> ${_logdir}/pear_install.log
echo "cd /tmp" >> ${_logdir}/pear_install.log
echononl "\tChange into TMP dir '/tmp'.."
cd /tmp >> ${_logdir}/pear_install.log 2>&1
if [[ $? -gt 0 ]] ; then
echo_failed
error "Changinginto TMP dir '/tmp' failed! \n\t See logfile '${_logdir}/pear_install.log'"
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
else
echo_ok
fi
echo "" >> ${_logdir}/pear_install.log
echo "# - Update channel 'pear.php.net'.." >> ${_logdir}/pear_install.log
echo "# -" >> ${_logdir}/pear_install.log
echo "${PREFIX_PHP}/bin/pear channel-update pear.php.net" >> ${_logdir}/pear_install.log
echononl "\tUpdate channel 'pear.php.net'.."
${PREFIX_PHP}/bin/pear channel-update pear.php.net >> ${_logdir}/pear_install.log 2>&1
if [[ $? -gt 0 ]] ; then
echo_failed
error "Updating channel 'pear.php.net' failed! \n\t See logfile '${_logdir}/pear_install.log'"
echo ""
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interupted by user"
else
echo_ok
fi
PEAR_EXT="Net_Socket"
echo "" >> ${_logdir}/pear_install.log
echo "# - Install ${PEAR_EXT} via pear.." >> ${_logdir}/pear_install.log
@@ -8355,7 +8737,7 @@ if [[ -n "$zend_extension_opcache" ]];then
## -
## - sometimes un conjunction with
## -
## - [Sun May 11 23:02:25.120263 2014] [core:warn] [pid 11566:tid 139746681894656]
## - [Sun May 11 23:02:25.120263 2014] [core:warn] [pid 11566:tid 139746681894656]
## - AH00045: child process 28405 still did not exit, sending a SIGTERM
## -
echononl "\tphp.ini: opcache.fast_shutdown = 0 .."
@@ -8476,18 +8858,18 @@ if [[ -d "/usr/local/mysql" ]]; then
error "$(cat $tmp_err_msg)"
fi
fi
fi
fi
cd $pwd
cd ${CUR_PWD}
cat<<EOF
php.ini
php.ini
=======
You may edit your php.ini file "$PHP_INI_FILE"
to set more PHP options.
You may edit your php.ini file "$PHP_INI_FILE"
to set more PHP options.
EOF