From: kicom95 at daum dot net
Operating system: HP-UX 11.11
PHP version: 4.3.4
PHP Bug Type: Dynamic loading
Bug description: Invalid Library (Maybe not a PHP Library)
Description:
------------
HI,
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 Php.net 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 */
ZEND_FUNCTION(first_module);
/* compiled function list so Zend knows what's in this module */
zend_function_entry firstmod_functions[] =
{
ZEND_FE(first_module, NULL)
{NULL, NULL, NULL}
};
/* compiled module information */
zend_module_entry firstmod_module_entry =
{
STANDARD_MODULE_HEADER,
"First Module",
firstmod_functions,
NULL,
NULL,
NULL,
NULL,
NULL,
NO_VERSION_YET,
STANDARD_MODULE_PROPERTIES
};
/* implement standard "stub" routine to introduce ourselves to Zend */
#if COMPILE_DL_FIRST_MODULE
ZEND_GET_MODULE(firstmod)
#endif
/* implement function that is meant to be made available to PHP */
ZEND_FUNCTION(first_module)
{
long parameter;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", ¶meter)
== FAILURE) {
return;
}
RETURN_LONG(parameter);
}
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.
--
Edit bug report at http://bugs.php.net/?id=28332&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28332&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28332&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28332&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28332&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28332&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28332&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28332&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28332&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28332&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28332&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28332&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28332&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28332&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28332&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28332&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28332&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28332&r=float