php.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. 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 --enable-opcache
  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. printf "\n" | $IROOT/php-5.5.17/bin/pecl install -f redis
  34. # yaf.so
  35. printf "\n" | $IROOT/php-5.5.17/bin/pecl install -f yaf
  36. # phalcon.so
  37. # The configure seems broken, does not respect prefix. If you
  38. # update the value of PATH then it finds the prefix from `which php`
  39. export PATH=$IROOT/php-5.5.17/bin:$IROOT/php-5.5.17/sbin:$PATH
  40. git clone git://github.com/phalcon/cphalcon.git
  41. cd cphalcon
  42. git checkout phalcon-v1.3.2
  43. cd build/64bits
  44. $IROOT/php-5.5.17/bin/phpize
  45. ./configure --prefix=$IROOT/php-5.5.17 --enable-phalcon
  46. make
  47. make install
  48. # Clean up a bit
  49. rm -rf $IROOT/php
  50. touch $IROOT/php.installed