码迷,mamicode.com
首页 > Web开发 > 详细

PHP扩展开发

时间:2016-11-25 17:23:30      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:ons   autoconf   apt-get   make   文件中   support   目录   auto   nbsp   

安装好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扩展开发

标签:ons   autoconf   apt-get   make   文件中   support   目录   auto   nbsp   

原文地址:http://www.cnblogs.com/zbseoag/p/6102040.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!