steffc Posted November 12, 2003 Share Posted November 12, 2003 Has anyone managed to successfully embed php into a program? I\'ve been trying to but it keeps crashing. I do exactly as provided in phpembed.c but it just won\'t work. Have you guys had any luck with it? Quote Link to comment https://forums.phpfreaks.com/topic/1351-embedding-php/ Share on other sites More sharing options...
daeken Posted November 12, 2003 Share Posted November 12, 2003 I\'ve played with it a bit and haven\'t had any issues (except with thread safety). If you post your code here, i may be able to help you find the problem Quote Link to comment https://forums.phpfreaks.com/topic/1351-embedding-php/#findComment-4469 Share on other sites More sharing options...
touqen Posted November 12, 2003 Share Posted November 12, 2003 int main(int argc, char** argv){ zend_executor_globals executor_globals; PHP_EMBED_START_BLOCK(argc, argv); //php_embed_init(argc, argv); char *php_code = \"return \"This is a test\";\"; zval retval; zend_eval_string(php_code, &retval, \"Embedded Code\" TSRMLS_CC); PHP_EMBED_END_BLOCK(); //php_embed_shutdown(); return 0; } This is the code that I was using just to see if it would do anything but it would crash on the PHP_EMBED_START_BLOCK macro. I think it was the php_embed_init function that phpembed.c creates. This is steffc!! Quote Link to comment https://forums.phpfreaks.com/topic/1351-embedding-php/#findComment-4473 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.