• problem with php api

    From aotto1968@aotto1968@t-online.de to comp.lang.php on Wed May 31 10:22:21 2023
    From Newsgroup: comp.lang.php

    Hi,

    the following code fails if shared library is loaded with dl()


    ...
    PHP_MINIT_FUNCTION(phpmkkernel)
    {
    #if defined(ZTS) && defined(COMPILE_DL_PHPMKKERNEL)
    ZEND_TSRMLS_CACHE_UPDATE();
    #endif

    #if defined(ZTS)
    ...
    #endif

    /* If you have INI entries, uncomment these lines
    REGISTER_INI_ENTRIES();
    */

    return LibMkKernel_MInit (INIT_FUNC_ARGS_PASSTHRU) ;
    }


    static ZEND_RESULT_CODE LibMkKernel_MInit (INIT_FUNC_ARGS) {
    ...
    MK(MkErrorE) = zend_register_internal_enum("PhpMsgque\\MkKernel\\MkErrorE", IS_LONG, NULL);
    zend_enum_add_case_cstr(MK(MkErrorE), "OK", OT_TMP_INT_OBJ(0));
    zend_enum_add_case_cstr(MK(MkErrorE), "CONTINUE", OT_TMP_INT_OBJ(1));
    zend_enum_add_case_cstr(MK(MkErrorE), "ERROR", OT_TMP_INT_OBJ(2));
    ...
    return SUCCESS;
    }
    <<<<<

    the problem is an assert in create_enum_case_ast

    ZEND_ASSERT(ZSTR_IS_INTERNED(class_name));

    if shared library is loaded with "extension" in php.ini than it is fine

    extension="..."


    question: what I have to do ?

    mfg ao
    --- Synchronet 3.21d-Linux NewsLink 1.2
  • From Jerry Stuckle@stuckle.jerry@gmail.com to comp.lang.php on Wed May 31 11:56:32 2023
    From Newsgroup: comp.lang.php

    On 5/31/2023 4:22 AM, aotto1968 wrote:
    Hi,

    the following code fails if shared library is loaded with dl()


    ...
    PHP_MINIT_FUNCTION(phpmkkernel)
    {
    #if defined(ZTS) && defined(COMPILE_DL_PHPMKKERNEL)
    -a ZEND_TSRMLS_CACHE_UPDATE();
    #endif

    #if defined(ZTS)
    ...
    #endif

    -a /* If you have INI entries, uncomment these lines
    -a REGISTER_INI_ENTRIES();
    -a */

    -a return LibMkKernel_MInit-a-a-a-a (INIT_FUNC_ARGS_PASSTHRU)-a ;
    }


    static ZEND_RESULT_CODE LibMkKernel_MInit (INIT_FUNC_ARGS) {
    ...
    -a MK(MkErrorE) = zend_register_internal_enum("PhpMsgque\\MkKernel\\MkErrorE", IS_LONG,
    NULL);
    -a zend_enum_add_case_cstr(MK(MkErrorE), "OK", OT_TMP_INT_OBJ(0));
    -a zend_enum_add_case_cstr(MK(MkErrorE), "CONTINUE", OT_TMP_INT_OBJ(1));
    -a zend_enum_add_case_cstr(MK(MkErrorE), "ERROR", OT_TMP_INT_OBJ(2));
    ...
    -a return SUCCESS;
    }
    <<<<<

    the problem is an assert in create_enum_case_ast

    -a-a ZEND_ASSERT(ZSTR_IS_INTERNED(class_name));

    if shared library is loaded with "extension" in php.ini than it is fine

    -a-a extension="..."


    question: what I have to do ?

    mfg ao

    Well, to start with, you could show us the code you're using to load the library. What is the return value from dl()? Which OS are you using?
    --
    ==================
    Remove the "x"'s from my email address
    Jerry Stuckle
    stucklex.jerryx@gmail.com
    ==================

    --- Synchronet 3.21d-Linux NewsLink 1.2