php.sh 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #!/bin/bash
  2. RETCODE=$(fw_exists ${IROOT}/php.installed)
  3. [ ! "$RETCODE" == 0 ] || { \
  4. echo "Moving PHP config files into place";
  5. sudo cp $FWROOT/config/php.ini /usr/local/lib/php.ini
  6. sudo cp $FWROOT/config/php-fpm.conf /usr/local/lib/php-fpm.conf
  7. source $IROOT/php.installed
  8. return 0; }
  9. VERSION="5.5.17"
  10. PHP_HOME=$IROOT/php-$VERSION
  11. # Precaution, unlikely to happen.
  12. rm -rf $IROOT/php PHP_HOME cphalcon
  13. fw_get -o php-${VERSION}.tar.gz http://php.net/distributions/php-${VERSION}.tar.gz
  14. fw_untar php-${VERSION}.tar.gz
  15. mv php-${VERSION} php
  16. cd php
  17. echo "Configuring PHP quietly..."
  18. ./configure --prefix=$PHP_HOME --with-pdo-mysql \
  19. --with-mysql --with-mcrypt --enable-intl --enable-mbstring \
  20. --enable-fpm --with-fpm-user=testrunner --with-fpm-group=testrunner \
  21. --with-openssl --with-mysqli --with-zlib --enable-opcache --quiet
  22. echo "Making PHP quietly..."
  23. make --quiet
  24. echo "Installing PHP quietly"
  25. make --quiet install
  26. cd ..
  27. cp $FWROOT/config/php.ini $PHP_HOME/lib/php.ini
  28. cp $FWROOT/config/php-fpm.conf $PHP_HOME/lib/php-fpm.conf
  29. # =======================
  30. #
  31. # Install the PHP extensions that our tests need
  32. # Install all of them here becuase our config file references
  33. # all of these *.so
  34. # ========================
  35. echo PHP compilation finished, installing extensions
  36. $PHP_HOME/bin/pecl channel-update pecl.php.net
  37. # Apc.so
  38. $PHP_HOME/bin/pecl config-set php_ini $PHP_HOME/lib/php.ini
  39. printf "\n" | $PHP_HOME/bin/pecl -q install -f redis-2.2.5
  40. # yaf.so
  41. # printf "\n" | $PHP_HOME/bin/pecl -q install -f yaf
  42. # phalcon.so
  43. # The configure seems broken, does not respect prefix. If you
  44. # update the value of PATH then it finds the prefix from `which php`
  45. # fw_get -O https://github.com/phalcon/cphalcon/archive/phalcon-v1.3.2.tar.gz
  46. # fw_untar phalcon-v1.3.2.tar.gz
  47. # cd cphalcon-phalcon-v1.3.2/build/64bits
  48. # $PHP_HOME/bin/phpize
  49. # # For some reason we have to point to php-config
  50. # # explicitly, it's not found by the prefix settings
  51. # ./configure --prefix=$PHP_HOME --exec-prefix=$PHP_HOME \
  52. # --with-php-config=$PHP_HOME/bin/php-config \
  53. # --enable-phalcon --quiet
  54. # make --quiet
  55. # make install
  56. # mongodb.so
  57. printf "\n" | $PHP_HOME/bin/pecl -q install -f mongodb
  58. # Clean up a bit
  59. rm -rf $IROOT/php
  60. echo "export PHP_HOME=${PHP_HOME}" > $IROOT/php.installed
  61. echo -e "export PATH=\$PHP_HOME/bin:\$PHP_HOME/sbin:\$PATH" >> $IROOT/php.installed
  62. source $IROOT/php.installed