setup_hhvm.sh 1.0 KB

123456789101112131415161718192021
  1. #!/bin/bash
  2. export PHP_HOME=${IROOT}/php-5.5.17
  3. export COMPOSER_HOME=${IROOT}/php-composer
  4. export PHP_FPM=${PHP_HOME}/sbin/php-fpm
  5. export NGINX_HOME=${IROOT}/nginx
  6. sed -i 's|database_host: .*|database_host: '"${DBHOST}"'|g' app/config/parameters.yml
  7. sed -i 's|SourceRoot = .*/FrameworkBenchmarks/symfony2|SourceRoot = '"${TROOT}"'|g' deploy/config.hdf
  8. sed -i 's|Path = .*/.hhvm.hhbc|Path = '"${TROOT}"'/.hhvm.bbhc|g' deploy/config.hdf
  9. sed -i 's|PidFile = .*/hhvm.pid|PidFile = '"${TROOT}"'/hhvm.pid|g' deploy/config.hdf
  10. sed -i 's|File = .*/error.log|File = '"${TROOT}"'/error.log|g' deploy/config.hdf
  11. sed -i 's|root .*/FrameworkBenchmarks/php-symfony2| root '"${TROOT}"'|g' deploy/nginx.conf
  12. sed -i 's|/usr/local/nginx/|'"${IROOT}"'/nginx/|g' deploy/nginx.conf
  13. ${PHP_HOME}/bin/php app/console cache:clear \
  14. --env=prod --no-debug --no-warmup
  15. ${PHP_HOME}/bin/php app/console cache:warmup \
  16. --env=prod --no-debug
  17. hhvm -m daemon --config $TROOT/deploy/config.hdf --user $(whoami)
  18. $NGINX_HOME/sbin/nginx -c $TROOT/deploy/nginx.conf