Loading a Dll into PHP

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AccGir
    New Member
    • Mar 2007
    • 2

    Loading a Dll into PHP

    Hi Guys,

    I am new to PHP

    I already have a dll which is created using VC++.
    I need to call a function within this dll from php


    I know extension in php can help , but can someone give a detailed explanation?
    Can someone help me out...
  • mihai123
    New Member
    • Mar 2007
    • 13

    #2
    maybe this would help

    Comment

    • AccGir
      New Member
      • Mar 2007
      • 2

      #3
      Thanks for your quick and informative response....

      The manual described the function "int dl ( string $library )" to load a PHP extension at runtime.

      But, I faced the following problem in doing so....

      "
      Warning: dl() [function.dl]: Not supported in multithreaded Web servers - use extension=<dll filename>l in your php.ini in C:\Program Files\Apache Group\Apache2\h tdocs\test_dll. php on line 15

      Warning: dl() [<function.dl>]: Invalid library (maybe not a PHP library) '<dll filename>' in C:\Program Files\Apache Group\Apache2\h tdocs\test_dll. php on line 15
      "

      Please share your thoughts about this problem.

      Rgds,
      Accgir

      Comment

      • mihai123
        New Member
        • Mar 2007
        • 13

        #4
        Note: dl() is not supported in multithreaded Web servers. Use the extensions statement in your php.ini when operating under such an environment. However, the CGI and CLI build are not affected !

        You need to copy the dll in the extension directory of your PHP and then enter and modify your php.ini file.

        you should serch there for "extension" and find the proper directory and then add your extenstion. also in php.ini you should add your dll name in the extension area.

        The php.ini file has a lot of comment and it is easy to modify it. After you set your extension you need to restart you apache server.

        Comment

        • biij5698
          New Member
          • Oct 2011
          • 1

          #5
          try COM please.like this:$mycom = new COM ("mycom.myclass name") or die ("error");

          Comment

          Working...