ID: 13266
Updated by: hholzgra
Reported By: [EMAIL PROTECTED]
Status: Bogus
Bug Type: Dynamic loading
Operating System: Windows NT 4.0
PHP Version: 4.0.6
New Comment:

once again: ask the phpdev mailing list, please

supscription information can be found
on http://php.net/support.php

Previous Comments:
------------------------------------------------------------------------

[2001-09-13 01:43:30] [EMAIL PROTECTED]

Hi,

The module entry is in the source..
I am pasting header and source file for reference..

---------------------------------------------------------------------------
/* ------------------------------------------ */
/* php_mymodule.h --- after removing comments */
/* ------------------------------------------ */

#ifndef PHP_MYMODULE_H
#define PHP_MYMODULE_H

extern zend_module_entry mymodule_module_entry;
#define phpext_mymodule_ptr &mymodule_module_entry

#ifdef PHP_WIN32
#define PHP_MYMODULE_API __declspec(dllexport)
#else
#define PHP_MYMODULE_API
#endif

extern "C"
{
PHP_FUNCTION(confirm_mymodule_compiled);
}

#ifdef ZTS
#define MYMODULE_G(v) (mymodule_globals->v)
#define MYMODULE_LS_FETCH() zend_mymodule_globals *mymodule_globals = 
ts_resource(mymodule_globals_id)
#else
#define MYMODULE_G(v) (mymodule_globals.v)
#define MYMODULE_LS_FETCH()
#endif

#endif  /* PHP_MYMODULE_H */

/* ------------------------------------------ */
/* mymodule.cpp --- after removing comments   */
/* ------------------------------------------ */

#define DHAVE_APDEBUG 1 
#define DCOMPILE_DL_APDEBUG 1
#define ZTS 1

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "php.h"
#include <iostream.h>

extern "C"
{
#include "ext/standard/info.h"
#include "php_globals.h"
#include "php_ini.h"
#include "php_mymodule.h"
}

/* True global resources - no need for thread safety here */
static int le_mymodule;

/* Every user visible function must have an entry in mymodule_functions[]. */
function_entry mymodule_functions[] = {
        PHP_FE(confirm_mymodule_compiled,NULL)
        {NULL, NULL, NULL}      
};

zend_module_entry mymodule_module_entry = {
        "mymodule",
        mymodule_functions,
        NULL,NULL,NULL,NULL,NULL,
        STANDARD_MODULE_PROPERTIES
};

#ifdef COMPILE_DL_MYMODULE
extern "C"
{
ZEND_GET_MODULE(mymodule)
}
#endif

PHP_FUNCTION(confirm_mymodule_compiled)
{
        zval **arg;
        int len;
        char string[256];

        if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &arg) == FAILURE) 
        {WRONG_PARAM_COUNT;}

        convert_to_string_ex(arg);

        len = sprintf(string, "Congratulations! You have successfully modified 
ext/%.78s/config.m4. Module %.78s is now compiled into PHP.", "mymodule", 
Z_STRVAL_PP(arg));
        RETURN_STRINGL(string, len, 1);
}
---------------------------------------------------------------------------

Regards,

Atur Shah


------------------------------------------------------------------------

[2001-09-12 12:26:30] [EMAIL PROTECTED]

Make sure your module entry is in the source

#ifdef COMPILE_DL_YOURMODULE
ZEND_GET_MODULE(yourmodule)
#endif

- Markus

------------------------------------------------------------------------

[2001-09-12 11:51:17] [EMAIL PROTECTED]

support problem and most likely not a bug (at least not enough info to find out), 
please ask the phpdev mailing list (and give more info)

------------------------------------------------------------------------

[2001-09-12 11:40:45] [EMAIL PROTECTED]

HI,

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

The error when accessing PHP file in browser with Apache Web Server is :

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

I used these configurations :

PHP 4.0.6
Apache 1.3.20
Windows NT 4.0
Visual C++ 6.0

Comments Please.

Thanks.

Atur Shah.
([EMAIL PROTECTED])

------------------------------------------------------------------------



Edit this bug report at http://bugs.php.net/?id=13266&edit=1


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to