Supress error message to apache log?

From: Date: Mon, 05 Mar 2001 17:33:36 +0000
Subject: Supress error message to apache log?
Groups: php.general 
Request: Send a blank email to php-general+get-42640@lists.php.net to get a copy of this message
I have the following php function- function doclink ($documentdir, $rpmname, $doc_file) { $string="rpm -qd $rpmname |head -1 |sed s?\"$documentdir\"?\"\"? |cut -d\"/\" -f2"; $rpm_installed=exec($string); $DOC_ABSOLUTE="$documentdir/$rpm_installed"; if (file_exists("$DOC_ABSOLUTE/$doc_file")) { if (is_link("$rpmname")) { unlink("$rpmname"); } symlink("$DOC_ABSOLUTE", "$rpmname"); return "$rpmname/$doc_file"; } else { return "failed"; } } later its used when creating a page of documentation links for the user, like this- $mysqldoc=doclink($docdir, "MySQL", "manual_toc.html"); if (strstr($mysqldoc,"failed")) { echo "<!-- could not locate MySQL documentation -->\n"; } else { echo "<P><font face=$font color=$color size=$size><A href=\"$mysqldoc\">MySQL Documentation</A></font>\n"; } Works beautifully, problem is- if the rpm isn't installed that's querried in the doclink function, the error message rpm puts out is sent to the apache error.log. I don't want that. Is there a way to supress the error message for that exec call? Thanks -=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michael A. Peters Abriasoft Senior Developer http://www.abriasoft.com/ (510) 623-9726x357 Fax: (510) 249-9125

« previous php.general (#42640) next »