From 25239b51567b86c3e6723fc2c7f7ebbd50ec968b Mon Sep 17 00:00:00 2001 From: Shivam Mathur Date: Sun, 1 Nov 2020 04:14:38 +0530 Subject: [PATCH] Add php-dev and php-pear (#1944) --- images/linux/scripts/installers/php.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/images/linux/scripts/installers/php.sh b/images/linux/scripts/installers/php.sh index b8e2b8ed1..5abbb4b59 100644 --- a/images/linux/scripts/installers/php.sh +++ b/images/linux/scripts/installers/php.sh @@ -66,7 +66,6 @@ for version in $php_versions; do if [[ $version == "5.6" || $version == "7.0" || $version == "7.1" ]]; then apt-fast install -y --no-install-recommends php$version-mcrypt php$version-recode - apt-get remove --purge -yq php$version-dev fi if [[ $version == "7.2" || $version == "7.3" ]]; then @@ -81,13 +80,12 @@ apt-fast install -y --no-install-recommends \ php-memcache \ php-memcached \ php-mongodb \ + php-pear \ php-redis \ php-xdebug \ php-yaml \ php-zmq -apt-get remove --purge -yq php7.2-dev - apt-fast install -y --no-install-recommends snmp # Install composer @@ -113,17 +111,23 @@ mv phpunit /usr/local/bin/phpunit # Run tests to determine that the software installed as expected echo "Testing to make sure that script performed as expected, and basic scenarios work" -for cmd in php $php_versions composer phpunit; do - if [[ $cmd =~ ^[0-9] ]]; then - cmd="php$cmd" - fi - +for cmd in composer pear pecl phpunit; do if ! command -v $cmd; then echo "$cmd was not installed" exit 1 fi done +for version in $php_versions; do + if ! command -v php$version; then + echo "php$version was not installed" + exit 1 + elif ! command -v php-config$version || ! command -v phpize$version; then + echo "php$version-dev was not installed" + exit 1 + fi +done + # ubuntu 20.04 libzip-dev is libzip5 based and is not compatible libzip-dev of ppa:ondrej/php # see https://github.com/actions/virtual-environments/issues/1084 if isUbuntu20 ; then