Office online integration with PHP RRS feed

  • Question

  • Hello Support,

    We are trying to integrate Microsoft office online with PHP web application but we are not getting any sample PHP WOPI HOST. We have already installed Office web apps server and have discovery URL, But we are not getting how to create WOPI host and integrate it with Office Web Apps server. We have already read WOPI documentation but not able to get how to create and integrate it with our Application. Could you please help us in this matter and let us know how to create a WOPI host in PHP.

    Looking forward.

    Thanks in Advance

    Tuesday, December 18, 2018 2:03 PM

All replies

  • Hi Gurpreet, 

    If you are integrating with Office Web Apps Server 2013 or Office Online Server 2016, then we can assist you with this question. If you are integrating with Office Online (Office365 cloud product), please direct your question to the Yammer discussion group for the Cloud Storage Partner Program. You can find information on CSPP here:


    Either way, there is sample code for WOPI Host implementers that can be very helpful. It is provided to accompany the online documentation for integration: 




    There is also a sample using C# and MVC that might be helpful to you: 


    After reviewing these, if you have a specific question about the WOPI protocol, please post it on this forum and reference the [MS-WOPI] section you are having trouble with and we will assist you.

    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications

    Tuesday, December 18, 2018 4:55 PM
  • Hello Tom,

    Thanks for your reply.

    We are using web apps server 2013 on premises and also created a PHP Wopi host. We can view the Docx file properly in the viewer but we are not able to edit it. When we try to open Docx file in the editor it says "Sorry, you don't have permission to edit this document". We have only tested it with Docx files as of now. We have only created CheckFileInfo, GetFile, PutFile REST Endpoints. We don't want to support file locking while editing. 

    Could you please review and let us know what is wrong with the implementation? and help us to get rid of this permission error.

    Gurpreet Rajpal

    Wednesday, December 19, 2018 1:44 PM
  • Hi Gurpreet, 

    Office Web Apps Server 2013 requires FSSHTTP support to provide Word document editing. If you have implemented: 

    [MS-FSSHTTP]: File Synchronization via SOAP over HTTP Protocol

    in your WOPI host server, then you can set the WOPI CheckFileInfo response variable "SupportsCobalt" to let Office Web Apps Server know and editing will be attempted. 

    Office Online Server 2016 does not have this additional requirement and editing Word documents can be accomplished without implementing FSSHTTP.

    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications

    Wednesday, December 19, 2018 8:48 PM
  • Hello Tom,

    We are also getting one more error while trying to edit any document "Sorry, you don't have permission to edit this document". Do you have any idea why we are getting this message? 

    Thanks in advance

    Thursday, December 20, 2018 10:41 AM
  • Hi Gurpreet, 

    This could be any number of reasons. Have you already debugged the host code to see if the problem is simple access to the underlying file? 

    Another possibility is that you have not set the CheckFileInfo response properties for that specific file to allow editing (i.e. UserCanEdit). 

    After checking out the above mentioned possibilities, if you still need help in analyzing this, I will need to see a fiddler trace that includes the WOPI protocol request/responses and the ULS logs (I can give you instructions) to match. To take this route, please send an email to dochelp@microsoft.com, referencing the URL for this forum thread and my name. I will guide you in gathering these data and assist in troubleshooting.


    Thursday, December 20, 2018 5:33 PM
  • Hello Tom,

    Hope you are doing great!

    I have created WOPI HOST successfully and it is working fine but I am having a problem while editing any document in office online editor. I need to update the viewer and generate a PDF from DOCX as soon as the user closes the editor Modal window but I am not getting updated Docx file even after waiting for 5 - 6 seconds before generating PDF. 

    Can we hit PUTFILE operation before closing the office online editor Modal? Or is there any other way to fix this issue?

    Can you please help me to sort out this?

    I will really appreciate your help.


    Wednesday, January 2, 2019 12:29 PM
  • Hello Gurpreet,

    Thank you for your question. One of our protocols engineers will respond soon. 


    Jeff McCashland | Microsoft Protocols Open Specifications Team

    Wednesday, January 2, 2019 4:26 PM
  • Hi Gurpreet,

    Likely the problem is that the host's web app is not navigating away from the Office Online page. Office web app detects this and provides the final PutFile to update the document. Usually, the host's page is navigated to a new host page.

    You can't actually force the PutFile from the host code but it shouldn't be necessary if you properly navigate after the edit session.

    Usually this means navigating to the viewer or to another page.

    The following describes the putfile behavior of Office Online for Word: 


    Another possible reason is related to the file version that needs to be updated and that is described here: 


    Hope this helps,


    Wednesday, January 2, 2019 4:53 PM
  • If you still need assistance, please send an email to dochelp at microsoft.com referencing the URL for this (or the other) thread and my name. I will likely need to make arrangements to gather data from you.



    Monday, January 7, 2019 6:16 PM