php.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. ls
  15. mv php-${VERSION} php
  16. ls
  17. cd php
  18. ./configure --prefix=$IROOT/php-${VERSION} --with-pdo-mysql \
  19. --with-mysql --with-mcrypt --enable-intl --enable-mbstring \
  20. --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data \
  21. --with-openssl --enable-opcache
  22. make
  23. make install
  24. cd ..
  25. cp $FWROOT/config/php.ini $IROOT/php-${VERSION}/lib/php.ini
  26. cp $FWROOT/config/php-fpm.conf $IROOT/php-${VERSION}/lib/php-fpm.conf
  27. # =======================
  28. #
  29. # Install the PHP extensions that our tests need
  30. # Install all of them here becuase our config file references
  31. # all of these *.so
  32. # ========================
  33. echo PHP compilation finished, building modules
  34. # Apc.so
  35. $IROOT/php-${VERSION}/bin/pecl config-set php_ini $IROOT/php-${VERSION}/lib/php.ini
  36. #printf "\n" | $IROOT/php-5.5.17/bin/pecl install -f apc-beta
  37. printf "\n" | $IROOT/php-${VERSION}/bin/pecl install -f redis
  38. # yaf.so
  39. printf "\n" | $IROOT/php-${VERSION}/bin/pecl install -f yaf
  40. # phalcon.so
  41. # The configure seems broken, does not respect prefix. If you
  42. # update the value of PATH then it finds the prefix from `which php`
  43. #export PATH=$IROOT/php-5.5.17/bin:$IROOT/php-5.5.17/sbin:$PATH
  44. #git clone git://github.com/phalcon/cphalcon.git
  45. #cd cphalcon
  46. #git checkout phalcon-v1.3.2
  47. #cd build/64bits
  48. #$IROOT/php-5.5.17/bin/phpize
  49. #./configure --prefix=$IROOT/php-5.5.17 --enable-phalcon
  50. #make
  51. #make install
  52. # Clean up a bit
  53. rm -rf $IROOT/php
  54. touch $IROOT/php.installed