Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save deanoakley/f4bcfe047c9798b1e667223a7d5dd839 to your computer and use it in GitHub Desktop.
Save deanoakley/f4bcfe047c9798b1e667223a7d5dd839 to your computer and use it in GitHub Desktop.
Serverpilot disable display php errors server-wide
# Append 'display_errors = false' to each PHP version's ini file
echo 'display_errors = false' | sudo tee --append /etc/php7.4-sp/php.ini &&
echo 'display_errors = false' | sudo tee --append /etc/php8.0-sp/php.ini &&
echo 'display_errors = false' | sudo tee --append /etc/php8.1-sp/php.ini &&
echo 'display_errors = false' | sudo tee --append /etc/php8.2-sp/php.ini &&
echo 'display_errors = false' | sudo tee --append /etc/php8.3-sp/php.ini &&
# Display the contents of each ini file to confirm the changes
cat /etc/php7.4-sp/php.ini &&
cat /etc/php8.0-sp/php.ini &&
cat /etc/php8.1-sp/php.ini &&
cat /etc/php8.2-sp/php.ini &&
cat /etc/php8.3-sp/php.ini &&
# Restart each PHP-FPM service to apply the changes
sudo service php7.4-fpm-sp restart &&
sudo service php8.0-fpm-sp restart &&
sudo service php8.1-fpm-sp restart &&
sudo service php8.2-fpm-sp restart &&
sudo service php8.3-fpm-sp restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment