0

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 with cmd.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
gvlasov
  • 18,638
  • 21
  • 74
  • 110
MGS
  • 21
  • 1
  • 7
  • 1
    Could you share some code please? – Mureinik Mar 07 '15 at 12:20
  • Hi thanks! Well the code is very simple if you echo the exec('officetopdf.exe input.doc output.pdf') it throws the error described. It's a dcom permission problem but we can't figure it out. – MGS Mar 07 '15 at 12:55
  • Did you found a solution? Have the same problem. What was the DCOM setting on the Windows 8 computer? – Tim Sep 23 '15 at 10:01
  • Hi! At the end we manage to make it work using wamp and not IIS and changing DCOM permissions. The issue was with IIS. – MGS Oct 14 '15 at 18:43

0 Answers0