Reputation: 3069
I am executing gzip
on a debian server via php using the exec()
function.
gzip -1 -c file1.xxx > file1.gz
Now I want to errors to be saved in some error.log.
shell_exec()
?Upvotes: 0
Views: 385
Reputation: 31274
to redirect stderr
to a file, use the 2>
redirector (2
is the file-handle for the stderr):
gzip -1 -c file1.xxx >file1.gz 2>error.log
(see also the REDIRECTION section man bash
)
Upvotes: 1