displayerrors with the /go/displayerrors Command

/go/displayerrors controls PHP's display_errors setting, which decides whether PHP prints errors and warnings in the page or the command output. It writes the value into every php.ini it finds, for all installed PHP versions, and then schedules a PHP-FPM reload so the change takes effect. The command sets a value. It does not flip the setting back and forth. With no value it always sets On. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Show the current value
/go/displayerrors return

# Turn it off (recommended for live sites)
/go/displayerrors Off

# Turn it on
/go/displayerrors On

Arguments

Argument Required Notes
return No Prints the current value and changes nothing. Not case-sensitive.
<value> No The value to write, usually On or Off. PHP also accepts values such as 1, 0, stdout, and stderr. The value is not checked.
(none) No Sets On.

If the first argument starts with --, it is ignored and the value is set to On.

Pass only the value. The command writes all of its arguments into php.ini, so extra words such as Off --progress end up in the file.

Examples

# Check, change, and check again
/go/displayerrors return
/go/displayerrors Off
/go/displayerrors return

# Check the value that PHP on the command line is using
php -r 'echo ini_get("display_errors"), PHP_EOL;'

# Compare the value in every php.ini
sudo grep -H '^display_errors' /etc/php.ini /etc/opt/remi/*/php.ini 2>/dev/null

Output

Display Errors updated successfully.

The message is printed after the files have been processed, even if no php.ini was found.

With return, the command prints the current value, for example Off, and exits with status 1, even though nothing went wrong. A blank line means no value is set.

Message Meaning
Display Errors updated successfully. The run finished.
Unknown operating system. The OS is not AlmaLinux, Rocky, CentOS, Red Hat, Fedora, Debian, or Ubuntu. Nothing is changed.

See the full reference at /go/displayerrors and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *