php.sh 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. return 0; }
  11. VERSION="5.5.17"
  12. fw_get http://php.net/distributions/php-${VERSION}.tar.gz -o php-${VERSION}.tar.gz
  13. fw_untar php-${VERSION}.tar.gz
  14. mv php-${VERSION} php
  15. cd php
  16. echo "Configuring PHP quietly..."
  17. ./configure --prefix=$IROOT/php-${VERSION} --with-pdo-mysql \
  18. --with-mysql --with-mcrypt --enable-intl --enable-mbstring \
  19. --enable-fpm --with-fpm-user=testrunner --with-fpm-group=testrunner \
  20. --with-openssl --with-mysqli --with-zlib --enable-opcache --quiet
  21. echo "Making PHP quietly..."
  22. make --quiet
  23. echo "Installing PHP quietly"
  24. make --quiet install
  25. cd ..
  26. cp $FWROOT/config/php.ini $IROOT/php-${VERSION}/lib/php.ini
  27. cp $FWROOT/config/php-fpm.conf $IROOT/php-${VERSION}/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 PHP compilation finished, installing extensions
  35. $IROOT/php-${VERSION}/bin/pecl channel-update pecl.php.net
  36. # Apc.so
  37. $IROOT/php-${VERSION}/bin/pecl config-set php_ini $IROOT/php-${VERSION}/lib/php.ini
  38. #printf "\n" | $IROOT/php-5.5.17/bin/pecl install -f apc-beta
  39. printf "\n" | $IROOT/php-${VERSION}/bin/pecl -q install -f redis
  40. # yaf.so
  41. printf "\n" | $IROOT/php-${VERSION}/bin/pecl -q install -f yaf
  42. printf "\n" | $IROOT/php-${VERSION}/bin/pecl -q install -f mongo
  43. # phalcon.so
  44. # The configure seems broken, does not respect prefix. If you
  45. # update the value of PATH then it finds the prefix from `which php`
  46. git clone --depth=1 --branch=phalcon-v1.3.2 --single-branch \
  47. --quiet git://github.com/phalcon/cphalcon.git
  48. cd cphalcon/build/64bits
  49. $IROOT/php-5.5.17/bin/phpize
  50. # For some reason we have to point to php-config
  51. # explicitly, it's not found by the prefix settings
  52. ./configure --prefix=$IROOT/php-${VERSION} --exec-prefix=$IROOT/php-${VERSION} \
  53. --with-php-config=$IROOT/php-${VERSION}/bin/php-config \
  54. --enable-phalcon --quiet
  55. make --quiet
  56. make install
  57. # Clean up a bit
  58. rm -rf $IROOT/php
  59. touch $IROOT/php.installed