php7.sh 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #!/bin/bash
  2. RETCODE=$(fw_exists ${IROOT}/php7.installed)
  3. [ ! "$RETCODE" == 0 ] || { \
  4. echo "Moving PHP config files into place";
  5. source $IROOT/php7.installed
  6. return 0; }
  7. VERSION="7.0.1"
  8. PHP_HOME=$IROOT/php-$VERSION
  9. fw_get -o php-${VERSION}.tar.gz http://php.net/distributions/php-${VERSION}.tar.gz
  10. fw_untar php-${VERSION}.tar.gz
  11. mv php-${VERSION} php7
  12. cd php7
  13. echo "Configuring PHP quietly..."
  14. ./configure --prefix=$PHP_HOME --with-pdo-mysql \
  15. --with-mcrypt --enable-intl --enable-mbstring \
  16. --enable-fpm --with-openssl --with-mysqli \
  17. --with-zlib --enable-opcache --quiet
  18. echo "Making PHP quietly..."
  19. make --quiet
  20. echo "Installing PHP quietly"
  21. make --quiet install
  22. cd ..
  23. # Disable yaf and phalcon, for most PHP frameworks
  24. # (there is a similar line to enable the frameworks in their respective setup files)
  25. sed -i 's|^extension=yaf.so|;extension=yaf.so|g' $FWROOT/config/php.ini
  26. sed -i 's|^extension=phalcon.so|;extension=phalcon.so|g' $FWROOT/config/php.ini
  27. # Enable the correct Mongo DB plugin for PHP 7
  28. sed -i 's|^extension=mongo.so|;extension=mongo.so|g' $FWROOT/config/php.ini
  29. sed -i 's|;extension=mongodb.so|extension=mongodb.so|g' $FWROOT/config/php.ini
  30. cp $FWROOT/config/php.ini $PHP_HOME/lib/php.ini
  31. cp $FWROOT/config/php-fpm.conf $PHP_HOME/lib/php-fpm.conf
  32. # =======================
  33. #
  34. # Install the PHP extensions that our tests need
  35. # Install all of them here becuase our config file references
  36. # all of these *.so
  37. # ========================
  38. echo PHP7 compilation finished, installing extensions
  39. $PHP_HOME/bin/pecl channel-update pecl.php.net
  40. # Apc.so
  41. $PHP_HOME/bin/pecl config-set php_ini $PHP_HOME/lib/php.ini
  42. printf "\n" | $PHP_HOME/bin/pecl -q install -f redis-3.0.0
  43. #removed phalcon install - separate to toolset/setup/linux/frameworks
  44. # yaf.so - get working for php7 - also separate
  45. #printf "\n" | $PHP_HOME/bin/pecl -q install -f yaf
  46. # mongodb.so - mongo.so deprecated in php7 use mongodb.so
  47. printf "\n" | $PHP_HOME/bin/pecl -q install -f mongodb
  48. # Clean up a bit
  49. rm -rf $IROOT/php7
  50. echo "export PHP_HOME=${PHP_HOME}" > $IROOT/php7.installed
  51. echo -e "export PATH=\$PHP_HOME/bin:\$PHP_HOME/sbin:\$PATH" >> $IROOT/php7.installed
  52. source $IROOT/php7.installed