Hello,
The reason must be that the Module1.xba file used by the PHP user that calls LibreOffice is not the same than the user that runs LibreOffice directly or the PHP user doesn't have read access to the macro folder/file. We recommend you check this and add the macro to the Module1.xba file used by the PHP user that calls LibreOffice. And also test using PHP CLI and the web server.
Regards.