php.sh 2.0 KB

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