I want a php script to execute a command officetopdf.exe input.doc output.pdf
where officetopdf.exe
is an program that uses the installed Office to export office files to pdf.
When executed it throws the error:
‘Retrieving the COM class factory for component with CLSID {000209FF-0000-0000-C000-000000000046} failed due to the following error: 80070005 Access is denied.’
and does not execute properly.
- The server has IIS and Plesk panel. The user that calls PHP has been created with Plesk.
- When
officetopdf.exe
is executed directly withcmd.exe
it works well as expected. - It seems to be a problem of permissions of DCOM.
- On local environment on our office in another computer with Windows 8 changing DCOM permissions it worked well.
- On first install of office in the server all DCOM applications do not appear in DCOM config panel. I don't remember how we added but it wasn't automatically added because the Office was 32 bit and the system is 64 bit. If office 32 bit is installed the error 'Retrieving the COM class factory' changes to something like it does not find the class.
- Tested on 2 servers with Windows 2012