php - 在 php for linux 命令中停止错误报告

标签 php linux error-handling

我想停止与 php 一起使用的 linux 命令的错误。我怎样才能阻止这个错误?

我使用了error_reporting(0);

但未能阻止错误。

我的代码是这样的

`sudo touch $patch_detail_file`;
`sudo chmod 0777 -R $patch_detail_file`;

我的Apache2错误日志是这样的

chmod: cannot access 'Description/Tiguin-LBP-NetworkPrinter.description': No such file or directory
sh: 1: cannot create Description/Tiguin-LBP-NetworkPrinter.description: Directory nonexistent
touch: cannot touch '18092014/Description/Tiguin-Brother-MFCJ200.description': No such file or directory

最佳答案

通过 error_reporting,您只需禁用 php 在屏幕上或 PHP 错误日志中显示错误。您看到的是 Apache 网络服务器记录的错误消息。无法在运行时禁用它们。

关于php - 在 php for linux 命令中停止错误报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34527386/

相关文章:

ruby - 如何在 Ruby 中拯救 "invalid Unicode codepoint"?

php - Laravel 托管在子目录中

php - 手动创建一个 Symfony 上传文件

php - ODBC 未连接 HTML/PHP

php - 如何在PHP中获取 sphinx 连接失败错误

mysql - MySQL创建 “before insert”触发器失败并引发触发器错误

php - 如何存储拖放表单生成器的数组数据

linux - 如何根据行字段为每一行添加前缀

c - atomic.h 中的操作似乎是非原子的

Linux shell : prepend or append text to next line after matching line