|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28332 Invalid Library (Maybe not a PHP Library)
Submitted: 2004-05-09 08:01 UTC Modified: 2004-05-09 12:39 UTC
From: kicom95 at daum dot net Assigned:
Status: Not a bug Package: Dynamic loading
PHP Version: 4.3.4 OS: HP-UX 11.11
Private report: No CVE-ID: None
 [2004-05-09 08:01 UTC] kicom95 at daum dot net

I am trying to load newly made PHP extension module (C++).
(e.g. mymodule.dll) using dl().

Only 20 days ago, I didn't meet this message.

With the same Source files and Makefile, I tried to make my

module, but I couldn't make it.

With same module, In linux, solaris I could make my module.

and it works well.

But in HP after compiler patch( especially 'ld' ) it haven't

worked well.

My history is like this

1. 20 days ago

   I made my php-module, and it was successful.

    It works well.
   (in fact my colleage did this work )

2. 17 days ago

   I tried to make another program with C++ , but I met 

   g++ Compiler Error , so I did patch my compiler.

   After that I could make my another module.

3. 10 days ago

   I needed to do patch my first module.
   First I did backup previous module.
   After that I made patch module.

   At that time I met this message.

    Invalid Library (Maybe not a PHP Library) mymodule.dll

   at this time, I thought  I had mistake.

   so i restored my previous module.

4. 2 days ago

    I asked my colleage to compile this module.

    ( I thought he could , so we didn't backup )

   But it failed.

   We met this terrible message - 'Invalid Library (Maybe not a PHP Library)'

    I am sure We have had the same Makefile , and php interface.

5. today I visited and I could get the 'first module'

after that I did compile - this process is successful.

But...but I met same message. -_-

   what's wrong with our module?

   Does Compiler Bug makes this problem?

Please Help me.


Reproduce code:
/* include standard header */
#include "php.h"

/* declaration of functions to be exported */

/* compiled function list so Zend knows what's in this module */
zend_function_entry firstmod_functions[] =
    ZEND_FE(first_module, NULL)

/* compiled module information */
zend_module_entry firstmod_module_entry =
    "First Module",

/* implement standard "stub" routine to introduce ourselves to Zend */

/* implement function that is meant to be made available to PHP */
    long parameter;

    if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &parameter) == FAILURE) {


cc -fPIC -DPIC -DCOMPILE_DL=1 -I/usr/local/include -I. -I.. -I../Zend -c -o <your_object_file> <your_c_file>
Linking cc -shared -L/usr/local/lib  -o <your_module_file> <your_object_file(s)> 

In HP-ux with gcc -rdynamic option is invalild.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-09 12:39 UTC]
This isn't a support forum.
Ask extension development questions on
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Mar 03 03:01:28 2024 UTC