build.sh 823 B

1234567891011121314151617181920212223242526272829303132
  1. #! /bin/bash
  2. rm -rf runtime
  3. mkdir -p runtime/{bin,etc,lib,ext}
  4. cp bootstrap runtime/
  5. cp ~/php-7.4.0RC6-build/bin/php runtime/bin/
  6. cp ~/php-7.4.0RC6/php.ini-production runtime/etc/php.ini
  7. cp ~/php-7.4.0RC6-build/lib/php/extensions/no-debug-non-zts-20190902/* runtime/ext/
  8. echo "extension_dir=/opt/ext" >> runtime/etc/php.ini
  9. echo "extension=redis.so" >> runtime/etc/php.ini
  10. echo "extension=opcache.so" >> runtime/etc/php.ini
  11. for lib in libncurses.so.5 libtinfo.so.5 libpcre.so.0; do
  12. cp "/lib64/${lib}" runtime/lib/
  13. done
  14. for lib in libonig.so.2; do
  15. cp "/usr/lib64/${lib}" runtime/lib/
  16. done
  17. curl -sS https://getcomposer.org/installer | runtime/bin/php
  18. runtime/bin/php composer.phar require aws/aws-sdk-php
  19. cd runtime
  20. zip -r runtime.zip *
  21. mv runtime.zip ../
  22. cd ..
  23. zip -r vendor.zip vendor
  24. zip -r lambda.zip src