Compiling PHP Extensions in Visual C++

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sebastian Morawietz

    #1

    Compiling PHP Extensions in Visual C++

    Hi,

    I'm busy porting a PHP-Extension written by the company I work for from
    Linux to Win32 (XP).
    Everything worked fine. I fixed the errors and warnings, copied the dll
    to the extensions directory, entered the dll as extension into php.ini
    and this is, where trouble starts.

    When PHP is called on apache starting up, it throws an error at me
    saying "Unknown(): Unable to load dynamic library '...' Module not found.

    Then I browsed through the source code of the extensions, that are
    included in the php-4.3.6-sources, to figure out, what they are doing
    different - and at this point, the story gets weird:

    I compiled the bz2-Project (no errors, no warnings), and replaced
    php_bz2.dll in the extensions-Folder with the version I just compiled -
    resulting in the same "Unknown(): ..." Error-Message for php_bz2.dll (of
    course I checked, that the original indeed works).

    Has anyone heard of this problem before?

    TIA

    Sebastian Morawietz
  • Nathan Gardiner

    #2
    Re: Compiling PHP Extensions in Visual C++


    "Sebastian Morawietz" <studentcrossin g@gmx.de> wrote in message
    news:c9hnoi$i6a $1@sagnix.uni-muenster.de...[color=blue]
    > Hi,
    >
    > I'm busy porting a PHP-Extension written by the company I work for from
    > Linux to Win32 (XP).
    > Everything worked fine. I fixed the errors and warnings, copied the dll
    > to the extensions directory, entered the dll as extension into php.ini
    > and this is, where trouble starts.
    >
    > When PHP is called on apache starting up, it throws an error at me
    > saying "Unknown(): Unable to load dynamic library '...' Module not found.
    >
    > Then I browsed through the source code of the extensions, that are
    > included in the php-4.3.6-sources, to figure out, what they are doing
    > different - and at this point, the story gets weird:
    >
    > I compiled the bz2-Project (no errors, no warnings), and replaced
    > php_bz2.dll in the extensions-Folder with the version I just compiled -
    > resulting in the same "Unknown(): ..." Error-Message for php_bz2.dll (of
    > course I checked, that the original indeed works).
    >
    > Has anyone heard of this problem before?
    >
    > TIA
    >
    > Sebastian Morawietz[/color]

    Sebastian,

    Which compiler environment are you using?
    It is possible that a library you're dynamically linking against isn't
    available to PHP.

    Have you checked the Makefile to determine the exact options used to compile
    the extensions?


    Nathan


    Comment

    • Doug Hutcheson

      #3
      Re: Compiling PHP Extensions in Visual C++

      "Sebastian Morawietz" <studentcrossin g@gmx.de> wrote in message
      news:c9hnoi$i6a $1@sagnix.uni-muenster.de...[color=blue]
      > Hi,
      >
      > I'm busy porting a PHP-Extension written by the company I work for from
      > Linux to Win32 (XP).
      > Everything worked fine. I fixed the errors and warnings, copied the dll
      > to the extensions directory, entered the dll as extension into php.ini
      > and this is, where trouble starts.
      >
      > When PHP is called on apache starting up, it throws an error at me
      > saying "Unknown(): Unable to load dynamic library '...' Module not found.
      >
      > Then I browsed through the source code of the extensions, that are
      > included in the php-4.3.6-sources, to figure out, what they are doing
      > different - and at this point, the story gets weird:
      >
      > I compiled the bz2-Project (no errors, no warnings), and replaced
      > php_bz2.dll in the extensions-Folder with the version I just compiled -
      > resulting in the same "Unknown(): ..." Error-Message for php_bz2.dll (of
      > course I checked, that the original indeed works).
      >
      > Has anyone heard of this problem before?
      >
      > TIA
      >
      > Sebastian Morawietz[/color]

      Sebastian,
      If your compiler is incrementing the internal version number of the .dll,
      you may find you need to run regsvr32 on that new .dll - depending on your
      o/s version etc.
      I encountered similar problems and this fixed it for me: your mileage may
      vary.
      Cheers,
      Doug

      --
      Remove the blots from my address to reply


      Comment

      Working...