olgoat Posted February 22, 2011 Share Posted February 22, 2011 Just started working with PHP and wrote a PHP extension in C. Got it working with hard coded variables and started to work on feeding it 3 string arguments as input. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss", &acct, &acct_len,&userid, &userid_len, &passwd, &passwd_len) == FAILURE) { RETURN_NULL(); } When I execute the extension with 3 arguments I always get the following. [XXX@XXXVIPH01 smxauth]$ php -r "smxauth('myacct','nobody','password');" PHP Warning: smxauth() expects exactly 1 parameter, 3 given in Command line code on line 1 I thought the "sss" would dictate the number of args expected but it doesn't seem to work that way (for me at least). Using php-5.1.6 Any thoughts? Thanks Tim Link to comment https://forums.phpfreaks.com/topic/228516-using-zend_parse_parameters-in-php-extension/ Share on other sites More sharing options...
olgoat Posted February 22, 2011 Author Share Posted February 22, 2011 Please disregard. Self inflicted. Forgot the step of copying the .so to the php ext modules directory like I had done previously. Used to LIBPATH in my C work. I was not picking up the updated module. Link to comment https://forums.phpfreaks.com/topic/228516-using-zend_parse_parameters-in-php-extension/#findComment-1178324 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.