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
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 \
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"
# 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