Com in PHP

Discussion in 'PHP' started by subangini, May 25, 2007.

  1. #1
    Hi,

    I created a dll file in Visual Basic
    Public function news()
    dim a,b as Integer
    a=2
    b=3
    msgbox a+b
    end function

    I am trying to call this dll in php thru the following code
    <html>
    <body>
    <?php
    $obj=new COM("test.trial");
    echo "hi";

    $output=$obj->news();

    echo $output;

    ?>
    </body>
    </html>

    where test is the dll name and trial is the class name.

    when i run this php file in command prompt like
    c:\php>php.exe "c:\Inetupub\wwwroot\use.php"
    its working

    but the same code is not running in the web pages when i click button.

    Can any 1 help me plsssss.

    thanks
     
    subangini, May 25, 2007 IP
  2. stugs

    stugs Peon

    Messages:
    157
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The user PHP runs as on your windows box doesn't have access to either the DLL or the locations that the DLL is trying to access.

    In a windows environment it is probably your IUSR_<MACHINENAME> that needs read access to the files. Make sure that it has read access to the directory it's stored in as well as the DLL itself.

    Short Answer: Permissions Problem :D
     
    stugs, May 25, 2007 IP
  3. subangini

    subangini Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hi,

    Can you explain in detail about IUSER_<MACHINENAME>

    pls
     
    subangini, May 29, 2007 IP
  4. gibex

    gibex Active Member

    Messages:
    1,060
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    95
    #4
    you need to have READ-ONLY access on that file under that IUSER
     
    gibex, May 29, 2007 IP