PHP accessing custom COM API

Posted on 2006-05-01
Last Modified: 2013-12-13

I am new to PHP so please bare with me.

I am trying to access a COM object using PHP. I have accessed this Object in VBA successfully using;

Set the_object = CreateObject("PrismWin.Connect")
MsgBox "Sucessfully loaded PWC object" & vbCrLf & "version: " & the_object.get_version & vbCrLf
if (the_object.login(sPrismPath, sClient, sUser, sPassword, PWC_Id) = 0) Then
MsgBox "Failed to login"
MsgBox "Successfully logged in"
end if

the_object.logout PWC_Id
MsgBox "logged out"

I have tried to use;

$the_object = new COM("PrismWin.Connect") or die("Cannot start PWC for you");
echo "Loaded PWC, version {$the_object->get_version}\n";

with no success. Can anyone help with this?

Question by:jset_expert
    LVL 9

    Expert Comment

    Does it die or do you get no object version?
    LVL 1

    Author Comment

    I get no version.

    Oh, I also forgot to mention that I am using PHP4 on a IIS webserver, I can port it over to Apache if there are any known issues with IIS.
    LVL 40

    Accepted Solution

    Just to confirm, you can run the VBA code you have on the webserver and it works?

    Remember that running the code on YOUR pc is not a guarantee that it will work on the server. You will need to have the COM server installed on the webserver.

    Of course, if your pc IS the webserver, then this is a moot point.

    Personally, I suspect that IIS needs to be configured in some way to allow you to use the COM server.

    Do you have MS Word installed on the webserver (if it is a real webserver, then I doubt you do!), then try the scripts in my user notes here ... (PHP COM & MS Word example.)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now