#!/bin/bash RETCODE=$(fw_exists ${IROOT}/php7.installed) [ ! "$RETCODE" == 0 ] || { \ echo "Moving PHP config files into place"; sudo cp $FWROOT/toolset/setup/linux/languages/php/php.ini /usr/local/lib/php.ini sudo cp $FWROOT/toolset/setup/linux/languages/php/php-fpm.conf /usr/local/lib/php-fpm.conf rm -rf /tmp/php_sessions /bin/bash $IROOT/php7/ext/session/mod_files.sh /tmp/php_sessions 3 5 source $IROOT/php7.installed return 0; } VERSION="7.2.1" PHP_HOME=$IROOT/php-$VERSION rm -rf $IROOT/php7 fw_get -o php-${VERSION}.tar.gz http://php.net/distributions/php-${VERSION}.tar.gz fw_untar php-${VERSION}.tar.gz mv php-${VERSION} php7 cd php7 echo "Configuring PHP quietly..." ./configure --prefix=$PHP_HOME --disable-debug \ --with-zlib --with-pdo-mysql=mysqlnd \ --enable-intl --enable-mbstring \ --enable-fpm --with-openssl \ --with-mysqli=mysqlnd --enable-huge-code-pages \ --quiet echo "Making PHP quietly..." make -j2 --quiet echo "Installing PHP quietly" make --quiet install cd .. # Disable yaf and phalcon, for most PHP frameworks # (there is a similar line to enable the frameworks in their respective setup files) sed -i 's|^extension=yaf.so|;extension=yaf.so|g' $FWROOT/toolset/setup/linux/languages/php/php.ini sed -i 's|^extension=phalcon.so|;extension=phalcon.so|g' $FWROOT/toolset/setup/linux/languages/php/php.ini # Enable the correct Mongo DB plugin for PHP 7 sed -i 's|^extension=mongo.so|;extension=mongo.so|g' $FWROOT/toolset/setup/linux/languages/php/php.ini sed -i 's|;extension=mongodb.so|extension=mongodb.so|g' $FWROOT/toolset/setup/linux/languages/php/php.ini cp $FWROOT/toolset/setup/linux/languages/php/php.ini $PHP_HOME/lib/php.ini cp $FWROOT/toolset/setup/linux/languages/php/php-fpm.conf $PHP_HOME/lib/php-fpm.conf rm -rf /tmp/php_sessions /bin/bash $IROOT/php7/ext/session/mod_files.sh /tmp/php_sessions 3 5 # ======================= # # Install the PHP extensions that our tests need # Install all of them here becuase our config file references # all of these *.so # ======================== echo PHP7 compilation finished, installing extensions $PHP_HOME/bin/pecl channel-update pecl.php.net # Apc.so $PHP_HOME/bin/pecl config-set php_ini $PHP_HOME/lib/php.ini #printf "\n" | $PHP_HOME/bin/pecl -q install -f redis-3.0.0 #removed phalcon install - separate to toolset/setup/linux/frameworks # yaf.so - get working for php7 - also separate #printf "\n" | $PHP_HOME/bin/pecl -q install -f yaf # mongodb.so - mongo.so deprecated in php7 use mongodb.so printf "\n" | $PHP_HOME/bin/pecl -q install -f mongodb echo "export PHP_HOME=${PHP_HOME}" > $IROOT/php7.installed echo -e "export PATH=\$PHP_HOME/bin:\$PHP_HOME/sbin:\$PATH" >> $IROOT/php7.installed source $IROOT/php7.installed