I am writing php script, which will be used for making sites from "standart" site. There's a lot of unix shell commands, and I've found the problem with displaying errors.
Example: I need to check that the site folder doesn't exist yet.
$ls_newsite = exec('ls /vhosts/'.$sitename, $output, $error_code);
if ($error_code == 0) {
Shell::error('This site already exists in /vhosts/');
}
Shell::output(sprintf("%'.-37s",$sitename).'OK!');
So, I can handle error, but it will be display anyway.
php shell.php testing.com
Checking site...
ls: cannot access /vhosts/testing.com: No such file or directory
testing.com.................................OK!
How can I prevent displaying? Thanks