我正在使用gzip
函数通过php在debian服务器上执行exec()
。
gzip -1 -c file1.xxx > file1.gz
现在我想将错误保存在一些error.log中。
shell_exec()
?答案 0 :(得分:1)
要将<VirtualHost *:80>
# Admin email, Server Name (domain name), and any aliases
ServerAdmin webmaster@example.co
ServerName www.example.co
ServerAlias example.co
# Index file and Document Root (where the public files are located)
DirectoryIndex index.html index.php
DocumentRoot /var/www/html/example.co/public_html
# Log file locations
LogLevel warn
ErrorLog /var/www/html/example.co/logs/error.log
CustomLog /var/www/html/example.co/logs/access.log combined
<Directory "/var/www/html/example.co/public_html">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
重定向到文件,请使用stderr
重定向器(2>
是stderr的文件句柄):
2
(另请参阅 REDIRECTION 部分gzip -1 -c file1.xxx >file1.gz 2>error.log
)