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