Forked from Jinksi/gist:d9856f3a053ce7ff29e39d51d6941da0
Last active
July 22, 2025 06:22
-
-
Save deanoakley/f4bcfe047c9798b1e667223a7d5dd839 to your computer and use it in GitHub Desktop.
Serverpilot disable display php errors server-wide
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Disable display_errors for all PHP versions on ServerPilot | |
| # This script appends 'display_errors = false' to each version's php.ini | |
| # and restarts the corresponding PHP-FPM services. | |
| # Run the full block as a single command to apply changes in one go: | |
| # | |
| # bash <(curl -s https://gist.githubusercontent.com/yourname/gistid/raw/disable-display-errors-serverpilot.sh) | |
| # | |
| # Useful for production environments to suppress PHP error output in the browser. | |
| # 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 && | |
| echo 'display_errors = false' | sudo tee --append /etc/php8.4-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 && | |
| sudo service php8.4-fpm-sp restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment