我使用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可以很好地使用这种命令。
如果您有一个主意,我会接受!