Home  >  Article  >  Backend Development  >  PHP extension development (1)-create basic framework, php framework_PHP tutorial

PHP extension development (1)-create basic framework, php framework_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 09:00:29840browse

PHP extension development (1) - Create basic framework, php framework

Generate the basic framework for PHP extension development. ​ 1. Under Linux ​

$>cd ~/{php source code}/ext

$>./ext_skel --extname=simple ​ Creating directory simple
Creating basic files: config.m4 config.w32 .svnignore simple.c php_simple.h CREDITS EXPERIMENTAL tests/001.phpt simple.php [done].

To use your new extension, you will have to execute the following steps:

1. $ cd ..
2. $ vi ext/simple/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-simple
5. $ make
6. $ ./php -f ext/simple/simple.php
7. $ vi ext/simple/simple. c
8. $ make

Repeat steps 3-6 until you are satisfied with ext/simple/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary. ​ 2. Under Windows ​ $>cd ~/{php source code}/ext $>php.exe ext_skel_win32.php --extname=simple ​ Creating directory simple
Creating basic files: config.m4 config.w32 .svnignore simple.c php_simple.h CREDITS EXPERIMENTAL tests/001.phpt simple.php [done].

To use your new extension, you will have to execute the following steps:

1. $ cd ..
2. $ vi ext/simple/config.m4
3. $ ./buildconf
4. $ ./configure --[with|enable]-simple
5. $ make
6. $ ./sapi/cli/php -f ext/simple/simple.php
7. $ vi ext/ simple/simple.c
8. $ make

Repeat steps 3-6 until you are satisfied with ext/simple/config.m4 and
step 6 confirms that your module is compiled into PHP. Then, start writing
code and repeat the last two steps as often as necessary.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1093867.htmlTechArticlePHP extension development (1) - Create a basic framework, and the php framework generates the basic framework for PHP extension development. 1. Under Linux $cd ~/{php source code}/ext $./ext_skel --extname=simpleCreating directory sim...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn