php exec错误,但与geobuf一起使用CLI

时间:2019-11-26 14:24:18

标签: php node.js exec

我使用geobuf npm,并且在控制台(user:root)上运行良好,但是使用php-exec(user:www-data),却出现此错误:

events.js:170
      throw er; // Unhandled 'error' event
      ^

Error: read EINVAL
    at Pipe.onStreamRead (internal/stream_base_commons.js:171:27)
Emitted 'error' event at:
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/task_queues.js:81:17)

命令是: echo exec('/usr/bin/json2geobuf / data.json > data.pbf');

奇怪的是它写入了data.pbf文件,但是它是空的,并且破坏了我的php-fpm(大量的cpu用法),就像命令/ usr / bin / json2geobuf根本不起作用。

我还有其他npm可以很好地使用这种命令。

如果您有一个主意,我会接受!

0 个答案:

没有答案