php7.sh 2.2 KB

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