Re: Supress error message to apache log?
| From: | Michael A. Peters | Date: | Mon, 05 Mar 2001 17:51:23 +0000 |
| Subject: | Re: Supress error message to apache log? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-42645@lists.php.net to get a copy of this message | ||
I feel dumb...
$string="rpm -qd $rpmname 2>/dev/null |head -1 |sed
s?\"$documentdir\"?\"\"? |cut -d\"/\" -f2";
On Monday, March 5, 2001, at 09:33 AM, Michael A. Peters wrote:
> 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
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michael A. Peters
Abriasoft Senior Developer
http://www.abriasoft.com/
(510) 623-9726x357
Fax: (510) 249-9125