Skip to content

Instantly share code, notes, and snippets.

@alex-79
Last active October 19, 2023 07:28
Show Gist options
  • Save alex-79/6a56ec9ee5464a8a1941d186f3e5283a to your computer and use it in GitHub Desktop.
Save alex-79/6a56ec9ee5464a8a1941d186f3e5283a to your computer and use it in GitHub Desktop.
#!/bin/bash
PHP_VER=8.1
sudo apt install php${PHP_VER}-bcmath php${PHP_VER}-cli php${PHP_VER}-common php${PHP_VER}-curl php${PHP_VER}-fpm php${PHP_VER}-gd php${PHP_VER}-intl php${PHP_VER}-mbstring php${PHP_VER}-mysql php${PHP_VER}-opcache php${PHP_VER}-readline php${PHP_VER}-soap php${PHP_VER}-xml php${PHP_VER}-xsl php${PHP_VER}-zip
sudo sed -i "s/memory_limit = .*/memory_limit = 2G/" /etc/php/${PHP_VER}/fpm/php.ini
sudo sed -i "s/upload_max_filesize = .*/upload_max_filesize = 256M/" /etc/php/${PHP_VER}/fpm/php.ini
sudo sed -i "s/zlib.output_compression = .*/zlib.output_compression = On/" /etc/php/${PHP_VER}/fpm/php.ini
sudo sed -i "s/max_execution_time = .*/max_execution_time = 18000/" /etc/php/${PHP_VER}/fpm/php.ini
sudo sed -i "s/;date.timezone.*/date.timezone = Europe\/Kiev/" /etc/php/${PHP_VER}/fpm/php.ini
sudo sed -i "s/;opcache.save_comments.*/opcache.save_comments = 1/" /etc/php/${PHP_VER}/fpm/php.ini
sudo sed -i "s/;max_input_vars = .*/max_input_vars = 1000000/" /etc/php/${PHP_VER}/fpm/php.ini
sudo sed -i "s/session.gc_maxlifetime = .*/session.gc_maxlifetime = 31536000/" /etc/php/${PHP_VER}/fpm/php.ini
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment