Windows 2008 PHP new COM(powerpoint.application)

Im using the following code below to open and export ppt slides as jpegs and this works fine on a windows 2003 server but on a windows 2008 server I get the following error:
“Caught exception: Source: Microsoft Office PowerPoint 2007 Description: PowerPoint could not open the file.D:\wwwroot\SlideManagerDemo\public\ emp\ est.ppt”
On windows 2008 I can see from the task manager that when I run this page, it creates the application instance fine but when I try to open/create files it just falls over.

(I do have msoffice 2007 installed on server)

Anyone have any further ideas (im sure im missing a tickbox somewhere?)


$strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"])))."\\\	emp\\\\";
$ppApp = new COM("powerpoint.application") or die("Unable to instantiate Powerpoint");
$ppApp->Visible = True;

$ppName = $strPath."test.ppt";
$FileName = "slides";

//*** Open Document if exists***//
if(file_exists($ppName)) {
    try {
        $pres = $ppApp->Presentations->Open($ppName, False, True, True);
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), $ppName, "\
";
    }

    try {
        $pres->SaveAs($strPath."\\\\".$FileName,17);  //'*** 18=PNG, 19=BMP **'
    } catch (Exception $e) {
        echo 'Caught exception: ',  $e->getMessage(), "\
";
    }

}

$ppApp->Quit;
$ppApp = null;

Additional configs added to the server are:
DCOM config

Component Services->Computers->My Computer->DCOM config-> Microsoft PowerPoint Presentation

[LIST][] Launch Permission - IUSR added with Local Activation permission
[
] Launch Permission - NETWORK SERVICES added with Local Activation permission
[] Local Activation - IUSR added with Local Activation permission
[
] Local Activation - NETWORK SERVICES added with Local Activation permission[/LIST]

php.ini

  • com.allow_dcom = true

folder permissions that contain ppt files

[LIST][] IUSR added with full control
[
] Everybody added with full control (makes no different)
[*] NETWORK SERVICES added with full control (makes no different)[/LIST]

Further notes:
Its worth mentioning that I have noticed a huge processor usage increase when upgrading from msoffice 2003 -> 2007

What is the app pool running as? I’d try a named user vs APP POOL IDENITITY.

Actually, I wouldn’t try and do this at all, especially with PHP. But if I had to do it I’d avoid APP POOL IDENTITY.

Thanks for you response but I have tried that… at least I think correctly.
iis/application pools/ sitename / set application pool defaults; (is this correct?)

the following user settings produce these responses:

NetworkService, LocalSystem , Administrator
Caught exception: Source: Microsoft Office PowerPoint 2007 Description: PowerPoint could not open the file

LocalService, ApplicationPoolIdentity, #myOwnUser
Caught exception: Failed to create COM object `powerpoint.application’: Access is denied

I really only have basic understandings of win2008 server management, so really am appreciative anymore ideas.
G

PROBLEM SOLVED!

This was a bit of an odd one but just as we were about to abandon it, we found the solution on a developer forum (http://social.msdn.microsoft.com/Forums/en/innovateonoffice/thread/b81a3c4e-62db-488b-af06-44421818ef91)
Basically a windows 2003 has a C:\Windows\System32\config\systemprofile\Desktop folder as default whereas on a windows 2008 this has been removed as default.
I created this file and all works… i can manipulate ppt and pptx files server side. (although Microsoft dont approve of msoffice automation)

Thanks Mr H Ogawa

Additional to this I created a new user (ppt_access) and added this to the DCOM config, folder permissions & application pool