SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: PHP/COM object

  1. #1
    SitePoint Enthusiast gazman99's Avatar
    Join Date
    May 2007
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP/COM object

    Hi all,

    Im trying to migrate a php application from an windows 2k3 server to an amazon's AWS EBS instance, which is windows 2008 Datacenter with IIS7.

    I have office installed on the instance and the relevant permissions assigned to the office powerpoint DCOM object.

    My problem is that DCOM object gets instantiated ok, but cannot open or save files.. i get the following error 'Source: Microsoft Office PowerPoint 2003 Description: Presentation.SaveAs : An error occurred while PowerPoint was saving the file.'

    This is the code im testing:
    Code PHP:
    $ppoint = new COM("PowerPoint.application") or die("Unable to instantiate PowerPoint"); 
    //Add a slide
    $slide=$ppoint->Presentations[1]->Slides->Add(1,1);
     
    //Get the name of this slide
    $slidename = $slide->Name();
     
    //Change the name of this new slide
    $slide->Name = "New Slidename";
     
    //Save the presentation
    $ppoint->Presentations[1]->SaveAs("D:\\wwwroot\\test.ppt");
    $ppoint->Presentations[1]->Close();

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Does the COM process user have sufficient access rights to the wwwroot folder ? Have you tried saving it elsewhere to see if permissions maybe an issue ?
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Enthusiast gazman99's Avatar
    Join Date
    May 2007
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I have tried multiple locations, with the 'everyone' and the iis user set to full control.

    Im thinking, is this an AWS issue, in the way it brings the EC2 operating system and EBS storage together. Or does that generally act just like any other webserver.

    I forgot to mention i upgrade PHP in process from 3.5.2 -> 3.5.6... if that makes a difference.

  4. #4
    SitePoint Enthusiast gazman99's Avatar
    Join Date
    May 2007
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I ended reverting back to an windows 2003 server with IIS6 installed.
    I assigned the "Launch IIS process account" permission to the ppt dcom object and bam it works.

    Im probably missing a tickbox somewhere on windows 2008, but from my little experience with windows2008 /iis7.... alot seems to be locked down as default.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •