php_setup.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/sh
  2. set -e
  3. echo "**************************"
  4. echo "Setting up PHP Extensions."
  5. echo "**************************"
  6. echo ""
  7. echo "PHP Version: $TRAVIS_PHP_VERSION"
  8. if [ "$TRAVIS_PHP_VERSION" = "hhvm" ] || [ "$TRAVIS_PHP_VERSION" = "hhvm-nightly" ]; then
  9. echo "Unable to install php extensions on current system"
  10. elif [ "$TRAVIS_PHP_VERSION" = "7.0" ]; then
  11. echo ""
  12. echo "******************************"
  13. echo "Installing apcu extension"
  14. echo "******************************"
  15. set +e
  16. printf "yes\n" | pecl install apcu
  17. set -e
  18. echo "Finished installing apcu-beta extension."
  19. else
  20. echo ""
  21. echo "******************************"
  22. echo "Installing phpredis extension."
  23. echo "******************************"
  24. echo ""
  25. echo ""
  26. echo "Downloading..."
  27. git clone git://github.com/nicolasff/phpredis.git
  28. echo "Configuring..."
  29. cd phpredis
  30. phpize
  31. ./configure
  32. echo "Installing..."
  33. make
  34. make install
  35. cd ..
  36. rm -Rf phpredis
  37. echo "Finished installing phpredis extension."
  38. echo ""
  39. echo "******************************"
  40. echo "Installing uopz extension if possible (PHP >=5.4)."
  41. echo "******************************"
  42. set +e
  43. pecl install uopz
  44. set -e
  45. echo "Finished installing uopz extension."
  46. if [ "$TRAVIS_PHP_VERSION" != "5.4" ]
  47. then
  48. echo ""
  49. echo "******************************"
  50. echo "Installing apcu extension"
  51. echo "******************************"
  52. set +e
  53. printf "yes\n" | pecl install apcu-4.0.8
  54. set -e
  55. echo "Finished installing apcu-beta extension."
  56. fi
  57. fi
  58. if [ -f "tests/travis/php_extensions_${TRAVIS_PHP_VERSION}.ini" ]
  59. then
  60. echo ""
  61. echo "*********************"
  62. echo "Updating php.ini file"
  63. echo "*********************"
  64. echo ""
  65. echo ""
  66. phpenv config-add "tests/travis/php_extensions_${TRAVIS_PHP_VERSION}.ini"
  67. fi