From 50396bf2aafd8d6c50958d3855d66a8eb2b40c4d Mon Sep 17 00:00:00 2001 From: gggeek Date: Wed, 23 Nov 2022 18:20:24 +0000 Subject: [PATCH] WIP CI test fixes --- tests/ci/setup/setup_php.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tests/ci/setup/setup_php.sh b/tests/ci/setup/setup_php.sh index fcae3b8a..ff326f6a 100755 --- a/tests/ci/setup/setup_php.sh +++ b/tests/ci/setup/setup_php.sh @@ -16,7 +16,7 @@ configure_php_ini() { echo "always_populate_raw_post_data = -1" >> "${1}" # we disable xdebug for speed for both cli and web mode - if which phpdesmod >/dev/null 2>/dev/null; then + if which phpdismod >/dev/null 2>/dev/null; then phpdismod xdebug elif [ -f /usr/local/php/$PHP_VERSION/etc/conf.d/20-xdebug.ini ]; then mv /usr/local/php/$PHP_VERSION/etc/conf.d/20-xdebug.ini /usr/local/php/$PHP_VERSION/etc/conf.d/20-xdebug.ini.bak @@ -51,10 +51,13 @@ else done if [ "${PHP_VERSION}" = 5.3 -o "${PHP_VERSION}" = 5.4 -o "${PHP_VERSION}" = 5.5 ]; then - # NB: this set of packages has only been tested on Focal so far + # @todo this set of packages has only been tested on Focal and Jammy so far + if [ "${DEBIAN_VERSION}" = jammy ]; then + ENCHANTSUFFIX='-2' + fi DEBIAN_FRONTEND=noninteractive apt-get install -y \ curl \ - enchant \ + enchant${ENCHANTSUFFIX} \ imagemagick \ libc-client2007e \ libcurl3-gnutls \ @@ -67,10 +70,13 @@ else libxslt1.1 \ mysql-common \ zstd + if [ ! -d /usr/include/php ]; then mkdir -p /usr/include/php; fi set +e curl -sSL https://github.com/shivammathur/php5-ubuntu/releases/latest/download/install.sh | bash -s "${PHP_VERSION}" + set -e + # we have to do this as the init script we get for starting/stopping php-fpm seems to be faulty... pkill php-fpm echo 'listen = /run/php/php-fpm.sock' >> "/usr/local/php/${PHP_VERSION}/etc/php-fpm.conf" @@ -122,8 +128,9 @@ service php-fpm start # reconfigure apache (if installed). Sadly, php will switch on mod-php and mpm_prefork at install time... if [ -n "$(dpkg --list | grep apache)" ]; then - # @todo silence errors in a smarter way - rm /etc/apache2/mods-enabled/php* || true + if [ -n "$(ls /etc/apache2/mods-enabled/php* 2>/dev/null)" ]; then + rm /etc/apache2/mods-enabled/php* + fi a2dismod mpm_prefork a2enmod mpm_event a2enconf php${PHPVER}-fpm -- 2.47.0