php.sh 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/sh
  2. #includes
  3. . ./config.sh
  4. . ./colors.sh
  5. #enable php fpm
  6. echo 'php_fpm_enable="YES"' >> /etc/rc.conf
  7. #set the default version of postgres
  8. echo "DEFAULT_VERSIONS+=pgsql=$database_version" >> /etc/make.conf
  9. echo "DEFAULT_VERSIONS+=ssl=openssl" >> /etc/make.conf
  10. #install dependencies
  11. if [ ."$php_version" = ."7.3" ]; then
  12. pkg install --yes php73 php73-phar php73-pdo php73-pdo_odbc php73-pdo_sqlite php73-json php73-gd php73-imap
  13. pkg install --yes php73-ldap php73-openssl php73-sockets php73-simplexml php73-xml php73-session php73-iconv
  14. pkg install --yes php73-zlib php73-filter php73-pdo_pgsql php73-pgsql php73-curl php73-mbstring
  15. fi
  16. if [ ."$php_version" = ."7.4" ]; then
  17. pkg install --yes php74 php74-phar php74-pdo php74-pdo_odbc php74-pdo_sqlite php74-json php74-gd php74-imap
  18. pkg install --yes php74-ldap php74-openssl php74-sockets php74-simplexml php74-xml php74-session php74-iconv
  19. pkg install --yes php74-zlib php74-filter php74-pdo_pgsql php74-pgsql php74-curl php74-mbstring
  20. pkg install --yes php74-pdo_pgsql php74-pgsql
  21. fi
  22. if [ ."$php_version" = ."8.0" ]; then
  23. pkg install --yes php80 php80-phar php80-pdo php80-pdo_odbc php80-pdo_sqlite php80-gd php80-imap
  24. pkg install --yes php80-ldap php80-sockets php80-simplexml php80-xml php80-session php80-iconv
  25. pkg install --yes php80-zlib php80-filter php80-curl php80-mbstring
  26. pkg install --yes php80-pdo_pgsql php80-pgsql
  27. fi
  28. if [ ."$php_version" = ."8.1" ]; then
  29. pkg install --yes php81 php81-phar php81-pdo php81-pdo_odbc php81-pdo_sqlite php81-gd php81-imap
  30. pkg install --yes php81-ldap php81-sockets php81-simplexml php81-xml php81-session php81-iconv
  31. pkg install --yes php81-zlib php81-filter php81-curl php81-mbstring
  32. pkg install --yes php81-pdo_pgsql php81-pgsql
  33. fi
  34. #send a message
  35. verbose "Configuring PHP"
  36. #update config if source is being used
  37. cp /usr/local/etc/php.ini-production /usr/local/etc/php.ini
  38. sed -i' ' -e s:'post_max_size = .*:post_max_size = 80M:g' /usr/local/etc/php.ini
  39. sed -i' ' -e s:'upload_max_filesize = .*:upload_max_filesize = 80M:g' /usr/local/etc/php.ini
  40. sed -i' ' -e s:'; max_input_vars = .*:max_input_vars = 8000:g' /usr/local/etc/php.ini
  41. #restart php-fpm
  42. service php-fpm restart