Calling extension function in zend_eval_string

三世轮回 提交于 2020-01-07 05:45:12

问题


When i try use zend_eval_string (i make mini php extension), there are no extensions functions avaliable. There are also no errors reporting (if php code have fatal error program exit). What i must do to enable extension and show errors when it executes? I also found interesting value EG(no_extensions)=1; in zend_execute_API.c, but when i change this value to 0 problem not solving. I am newer of c++ and please, tell me how to solve this problem with example.

Sorry for my bad English.


回答1:


Maybe help

int eval_php_code(char *code) {
    int ret = 0;

    zend_try {
        ret = zend_eval_string(code, NULL, (char *)"" TSRMLS_CC);
    } zend_catch {

    } zend_end_try();

    return ret == FAILURE;
}


来源:https://stackoverflow.com/questions/17383672/calling-extension-function-in-zend-eval-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!