php.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/bin/bash
  2. # TODO double check this, it's logically different from original php code.
  3. # Two path checks would both always run in php. In this code the check
  4. # for apc.so only happens if the check for php fails. Is that ok?
  5. RETCODE=$(fw_exists ${IROOT}/php.installed)
  6. [ ! "$RETCODE" == 0 ] || { \
  7. echo "Moving PHP config files into place";
  8. sudo cp $FWROOT/config/php.ini /usr/local/lib/php.ini
  9. sudo cp $FWROOT/config/php-fpm.conf /usr/local/lib/php-fpm.conf
  10. source $IROOT/php.installed
  11. return 0; }
  12. VERSION="5.5.17"
  13. PHP_HOME=$IROOT/php-$VERSION
  14. fw_get http://php.net/distributions/php-${VERSION}.tar.gz -O php-${VERSION}.tar.gz
  15. fw_untar php-${VERSION}.tar.gz
  16. mv php-${VERSION} php
  17. cd php
  18. echo "Configuring PHP quietly..."
  19. ./configure --prefix=$IROOT/php-${VERSION} --with-pdo-mysql \
  20. --with-mysql --with-mcrypt --enable-intl --enable-mbstring \
  21. --enable-fpm --with-fpm-user=testrunner --with-fpm-group=testrunner \
  22. --with-openssl --with-mysqli --with-zlib --enable-opcache --quiet
  23. echo "Making PHP quietly..."
  24. make --quiet
  25. echo "Installing PHP quietly"
  26. make --quiet install
  27. cd ..
  28. cp $FWROOT/config/php.ini $IROOT/php-${VERSION}/lib/php.ini
  29. cp $FWROOT/config/php-fpm.conf $IROOT/php-${VERSION}/lib/php-fpm.conf
  30. # =======================
  31. #
  32. # Install the PHP extensions that our tests need
  33. # Install all of them here becuase our config file references
  34. # all of these *.so
  35. # ========================
  36. echo PHP compilation finished, installing extensions
  37. $IROOT/php-${VERSION}/bin/pecl channel-update pecl.php.net
  38. # Apc.so
  39. $IROOT/php-${VERSION}/bin/pecl config-set php_ini $IROOT/php-${VERSION}/lib/php.ini
  40. #printf "\n" | $IROOT/php-5.5.17/bin/pecl install -f apc-beta
  41. printf "\n" | $IROOT/php-${VERSION}/bin/pecl -q install -f redis
  42. # yaf.so
  43. printf "\n" | $IROOT/php-${VERSION}/bin/pecl -q install -f yaf
  44. # Clean up a bit
  45. rm -rf $IROOT/php
  46. echo "export PHP_HOME=${IROOT}/php-5.5.17" > $IROOT/php.installed
  47. echo "export PATH=${PHP_HOME}/bin:$PHP_HOME/sbin:$PATH" >> $IROOT/php.installed
  48. source $IROOT/php.installed