首页 > 代码库 > PHP扩展开发
PHP扩展开发
安装好php,进入安装目录.
zbseoag@ubuntu:/usr/local/php-5.6.28/ext$ ./ext_skel --extname=mytest
zbseoag@ubuntu:/usr/local/php-5.6.28/ext$ cd mytest
zbseoag@ubuntu:/usr/local/php-5.6.28/ext/mytest$ gedit config.m4
###编辑文件(16 - 18行)
PHP_ARG_ENABLE(mytest, whether to enable mytest support,
dnl Make sure that the comment is aligned:
[ --enable-mytest Enable mytest support])
zbseoag@ubuntu:/usr/local/php-5.6.28/ext/mytest$ ../../scripts/phpize
zbseoag@ubuntu:/usr/local/php-5.6.28/ext/mytest$ sudo apt-get install autoconf
zbseoag@ubuntu:/usr/local/php-5.6.28/ext/mytest$ make
zbseoag@ubuntu:/usr/local/php-5.6.28/ext/mytest$ sudo make install
zbseoag@ubuntu:/usr/local/php-5.6.28/ext/mytest$ php -i | grep php.ini
###在ini文件中添加扩展: extension=mytest.so
zbseoag@ubuntu:/usr/local/php-5.6.28/ext/mytest$ php -r ‘echo confirm_mytest_compiled("\nHello World!")."\n";‘
Congratulations! You have successfully modified ext/mytest/config.m4. Module
Hello World! is now compiled into PHP.
PHP扩展开发
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。