Re: Successful system call output going to error log
- From: "Álvaro G. Vicario" <alvaro.NOSPAMTHANX@xxxxxxxxxxxxxx>
- Date: Tue, 27 Jan 2009 16:14:21 +0100
RoninTech escribió:
$cmd="xmllint --noout --schema validate.xsd file.xml";
Try providing the full path for validate.xsd and file.xml, just in case. You can remove it later if you learn it's not necessary.
$last_line = system($cmd,$retval);
Also, try using exec() instead, which allows you to capture the whole output. It's not unlikely that the last line is blank.
The weird thing is that I stumbled across this output in apache's
error log. Sure enough, every time I run the full command another
successful output gets tacked on the end of the error log.
It might be that xmllint sends its messages to the standard error. You can redirect it to stdout or /dev/null:
xmllint --noout --schema validate.xsd file.xml 2> /dev/null
xmllint --noout --schema validate.xsd file.xml 2>&1
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
.
- Follow-Ups:
- Re: Successful system call output going to error log
- From: RoninTech
- Re: Successful system call output going to error log
- References:
- Successful system call output going to error log
- From: RoninTech
- Successful system call output going to error log
- Prev by Date: Re: Simplexml - how to use it with ["@attributes"]=>
- Next by Date: Re: Mysql connection problem
- Previous by thread: Successful system call output going to error log
- Next by thread: Re: Successful system call output going to error log
- Index(es):