setup-php-fpm.sh 1.2 KB

123456789101112131415161718192021222324
  1. #!/bin/bash
  2. echo "* Preparing PHP-FPM ...";
  3. phpenv config-rm xdebug.ini
  4. # Using default configs
  5. cp ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  6. if [ -f ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ]; then
  7. cp -n ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf.default ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.d/www.conf;
  8. fi
  9. # Logging
  10. sudo touch /var/log/php-fpm.log && sudo chmod 777 /var/log/php-fpm.log
  11. sudo sed -e "s?;error_log = log/php-fpm.log?error_log = /var/log/php-fpm.log?g" --in-place ~/.phpenv/versions/$(phpenv version-name)/etc/php-fpm.conf
  12. # Additionnal configuration
  13. echo "cgi.fix_pathinfo = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  14. echo "always_populate_raw_post_data = -1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  15. echo "error_log = /var/log/php-fpm.log" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  16. echo "memory_limit = 2G" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
  17. # Starting PHP FPM
  18. ~/.phpenv/versions/$(phpenv version-name)/sbin/php-fpm