I am trying to convert .docx files from PHP on OS X Snow Leopard and I keep getting the error message:
kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
2013-05-16 06:45:25.065 soffice[1763:907] Error (1002) creating CGSWindow
I’m using the following code to call LibreOffice and initialize the conversion
"chdir(’/Applications/LibreOffice.app/Contents/MacOS’);
$myCommand = “./soffice --headless --accept=‘socket,host=127.0.0.1,port=8100;urp;’ --convert-to pdf /docfiles/$name --outdir /pdffile/ --nofirststartwizard”;
shell_exec($myCommand);"
Works fine when using terminal.
I understand that it is permission issue of sorts where OS X is preventing the _www apache user from starting an application of the admin user.
I am using version 4.0.3
Any guidance that can provided on how to resolve this will be greatly appreciated.