참고 페이지 : http://www.php.net/manual/en/zend.php
cd /home/ilashman/local/src/php-4.3.3/ext
./ext_skel --extname=my_module
cd..
vi ext/my_module/config.m4
./buildconf --force
./configure --with-my_modue --without-mysql --prefix=/home/ilashman/local/php-4.3.3
make -j 16
make install
/home/ilashman/local/php-4.3.3/bin/php -f /home/ilashman/local/src/php-4.3.3/ext/my_module/my_module.php
vi /home/ilashman/local/src/php-4.3.3/ext/my_module/my_module.c
------------------------------------------------------------------
my_module_test라는 함수를 만들고 싶다면
PHP_FUNCTION(my_module_test); 를 function_entry my_module_functions[] 앞 부분에 추가.
function_entry my_module_functions[] 에 PHP_FE(my_module_test, NULL) {NULL, NULL, NULL} 을 추가
PHP_FUNCTION(my_module_test)
{
long parameter;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", ¶meter) == FAILURE) {
return;
}
RETURN_LONG(parameter);
}
------------------------------------------------------------------
make -j 16
make install
댓글 없음:
댓글 쓰기