[Mac]Error when executing Script from Apache / PHP

Software:QCAD Pro 3.22.0.0
OS:Mac Mojave
PHP:v7.3.2

Hello.

The place where I ran the script that was taught at the above URL,
It runs on a terminal, but running from PHP with exec () results in the following error:

[do command]

qcad -no-gui -allow-multiple-instances -autostart qcad_purgeblock.js -f -o out.dxf in.dxf

[Apache Error Log]

QCAD version  3.22.0
16:40:35: Debug:    RDwgPlugin::init
16:40:35: Debug:    RDxfPlugin::init
16:40:35: Debug:    RHelpPlugin::init
16:40:35: Debug:    RPolygonPlugin::init
16:40:35: Debug:    RProScriptsPlugin::init
16:40:35: Debug:    RScriptsPlugin::init
16:40:35: Debug:    RSpatialIndexProPlugin::init
16:40:35: Debug:    RTriangulationPlugin::init
16:40:35: Debug:    calling odInitialize
16:40:35: Debug:    dropped global XDATA (no res buf):  "ViewportCenter"
2019-05-20 16:40:35.863 QCAD-Pro[52809:1569010] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted
16:40:35: Debug:    bb:  RBox(6.66667,7.83122: 283.323x202.377) 
16:40:35: Debug:    f: 1.3687309870976447
16:40:36: Debug:    RPluginBase::uninit:  "DWG"
16:40:36: Debug:    RPluginBase::uninit:  "POLYGON"
16:40:36: Debug:    RPluginBase::uninit:  "PROTOOLS"
16:40:36: Debug:    RPluginBase::uninit:  "SPATIALINDEXPRO"

As a result, the file is output but the contents are not purged.
And this error has occurred even if i delete the process to be purged.

What is the cause of this?

Sorry to bother you again.
thank you.

additional info.

This error seems to occur in the following.

if (!di.exportFile(outFile)) {
        di.destroy();
        print("Cannot export file:", outFile);
        return;
}

It runs on Linux (CentOS 7), so it may be just a Mac environment.
There is no problem if it can be run on Linux, so close it.

thank you.