Problems with External Php Extensions

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

    Problems with External Php Extensions

    I am trying to build a simple PHP Extension which simply returns a
    string object.

    I have followed the tutorial found on http://devzone.zend.com/node/view/id/1021
    up until the deployment stage. Instead of deploying the compiled
    module in the PHP Ini directory, I copied it in the same folder where
    the test.php page is. Then I am loading the module using the dl()
    method.

    By using the extension_loade d() method I am making sure that the
    extension is loaded successfully, however when I try to execute the
    GetMessage method found in the extension, the php compiler just
    crashes. ie. it stops compiling and does not issue any form of error
    message.

    I even tried to capture any exception thrown by calling the
    GetMessage() function from within a Try Catch block, however no
    exception is thrown, the compiler just crashes, or so it seems.

    Any idea what I might be doing incorrectly? Since the Extension
    compiles successfully and the module files are created without error,
    can I consider that step done? Or can the problem reside in the
    original source?

    Any help would be greatly appreciated.

    Thanks and Regards,
    Luke
  • Jerry Stuckle

    #2
    Re: Problems with External Php Extensions

    Luke wrote:
    I am trying to build a simple PHP Extension which simply returns a
    string object.
    >
    I have followed the tutorial found on http://devzone.zend.com/node/view/id/1021
    up until the deployment stage. Instead of deploying the compiled
    module in the PHP Ini directory, I copied it in the same folder where
    the test.php page is. Then I am loading the module using the dl()
    method.
    >
    By using the extension_loade d() method I am making sure that the
    extension is loaded successfully, however when I try to execute the
    GetMessage method found in the extension, the php compiler just
    crashes. ie. it stops compiling and does not issue any form of error
    message.
    >
    I even tried to capture any exception thrown by calling the
    GetMessage() function from within a Try Catch block, however no
    exception is thrown, the compiler just crashes, or so it seems.
    >
    Any idea what I might be doing incorrectly? Since the Extension
    compiles successfully and the module files are created without error,
    can I consider that step done? Or can the problem reside in the
    original source?
    >
    Any help would be greatly appreciated.
    >
    Thanks and Regards,
    Luke
    >
    Compilers only catch syntax errors. They won't catch things like access
    violations or any of a million other runtime errors you might have.

    You need to determine exactly where your problem lies. My bet is on
    your extension.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • NC

      #3
      Re: Problems with External Php Extensions

      On Oct 3, 4:23 am, Luke <luwk.ro...@gma il.comwrote:
      >
      I am trying to build a simple PHP Extension which simply
      returns a string object.
      There is no such thing as a "string object" in PHP. In PHP, strings
      are scalar...
      I have followed the tutorial found onhttp://devzone.zend.co m/node/view/id/1021
      up until the deployment stage. Instead of deploying the compiled
      module in the PHP Ini directory, I copied it in the same folder where
      the test.php page is. Then I am loading the module using the dl()
      method.
      dl() is not a method (meaning, it doesn't belong to any object), it is
      a function.

      Have you read the documentation for dl()? Are you sure that it is
      allowed on your system to load an extension from the directory where
      your scripts are located?

      Cheers,
      NC

      Comment

      Working...