I have a number of command line scripts in PHP that use exec() to perform tasks such as restarting services, loading MySQL timezone files, etc. While exec() itself does not
Just redirect stderr to /dev/null
stderr
/dev/null
$command = 'mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql 2>/dev/null';
or to stdout
stdout
$command = 'mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql 2>&1';