php扩展的基本结构

来源:互联网 发布:韩国妹子活好吗 知乎 编辑:程序博客网 时间:2024/05/17 03:32
[root@localhost ext]# ./ext_skel --extname=hehe[root@localhost ext]# cd hehe[root@localhost hehe]# vim config.m4[root@localhost hehe]#  vim php_hehe.h extern zend_module_entry hehe_module_entry;PHP_FUNCTION(hehe)[root@localhost hehe]#  vim hehe.cconst zend_function_entry hehe_functions[] = {        PHP_FE(confirm_hehe_compiled,   NULL)           /* For testing, remove later. */        PHP_FE(hehe,    NULL)           /* For testing, remove later. */        PHP_FE_END      /* Must be the last line in hehe_functions[] */};[root@localhost hehe]# /usr/local/php-7.0.7/bin/phpize [root@localhost hehe]# ./configure --with-php-config=/usr/local/php-7.0.7/bin/php-config [root@localhost hehe]# make[root@localhost hehe]# make installvim php.iniextstion=hehe.sophp -r "hehe();"
原创粉丝点击