...

View Full Version : how to disable php ouptut with system commands ?



graziano
03-08-2007, 12:55 PM
Hello

I have to execute this shell_exec command on my scripts



$executeonly=shell_exec("ls /etc/vmail -L -l -t");


if "ls" finds not existent symlinks it reports a lot of errors like this

no such file or directory
no such file or directory
no such file or directory
no such file or directory


Since I want hide this output , I'm trying



ob_start();
$executeonly=shell_exec("ls /etc/vmail -L -l -t");
ob_end_clean();


but I continue to receive

no such file or directory
no such file or directory
no such file or directory
no such file or directory

How to hide this shell_exec output ?

Thanks

Nightfire
03-08-2007, 01:29 PM
Maybe $executeonly=@shell_exec("ls /etc/vmail -L -l -t"); will work?

ralph l mayo
03-08-2007, 03:09 PM
You might also try appending 2>/dev/null to the command to get rid of the stderr channel

graziano
03-09-2007, 10:51 AM
nothing to do , unluckly none of these solution works ... argh .. :confused:

It's seems impossible to hide this output error

Inigoesdr
03-09-2007, 08:23 PM
shell_exec() returns the output as a string, so you shouldn't be seeing anything unless you explicitly echo/print it. Post the rest of your code you're using.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum