PHP扩展开发
2016-11-25 16:13
204 查看
安装好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.
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.
相关文章推荐
- 转 在Windows环境下进行PHP扩展的开发
- Linux/FreeBSD下用C语言开发PHP的so扩展模块例解
- PHP扩展开发笔记
- windows下开发PHP扩展dll(无需Cygwin)
- PHP 扩展开发笔记一
- 在Windows环境下进行PHP扩展的开发
- 利用SOAP扩展开发WebService(PHP)
- 快速开发一个PHP扩展
- 快速开发一个PHP扩展
- 一个简单php扩展介绍与开发教程
- Linux/FreeBSD下用C语言开发PHP的so扩展模块例解
- 快速开发一个PHP扩展
- [原创]快速开发一个PHP扩展
- 在 windows 下 用C++ 开发 PHP 扩展
- PHP扩展模块开发简解
- Linux/FreeBSD下用C语言开发PHP的so扩展模块例解
- Linux/FreeBSD下用C语言开发PHP的so扩展模块例解
- 快速开发一个PHP扩展图文教程
- java python php 经典开发流程 开发效率 运行效率&并发&可扩展
- 一个简单php扩展介绍与开发教程