PHP扩展开发
2024-08-26 06:03:43
安装好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.
最新文章
- 软件工程的引入:Scrum开发框架总结
- Linux文件系统扩容步骤
- day26_网络编程第一天
- MFC Initinstance中DoModal()返回-1
- 前台 JSON对象转换成字符串 相互转换 的几种方式
- 二分+贪心 hihocoder 1249 Xiongnu's Land (15北京A)
- 在Tomcat里使用配置连接池连接数据库
- HDU----(4549)M斐波那契数列(小费马引理+快速矩阵幂)
- Type-base dispatch
- 使用TypeDescriptor给类动态添加Attribute
- PAT1028—— 人口普查
- hdu1285+hdu2467(拓扑排序)
- 2017-06-30(ps pstree top kill w killall pkill)
- 【ESP8266】、ESP8266通讯使用的AT指令
- C语言实现字符串IP与整数型IP的相互转换
- pbs 作业管理命令
- 游戏:贪吃虫(GreedyMaggot)
- 479. Largest Palindrome Product
- hdu 5443 The Water Problem(长春网络赛——暴力)
- ie6 浏览器的bug