First, enter the PHP source installation package directory below to execute a command:
cd /home/oldboy/tools/php-5.5.32/ext/./ext_skel --extname=redis
Then go to the extension directory, you can see the following three files, respectively, to edit:
cd redis/lsconfig.m4 redis.c php_redis.h
Habit of getting back up before operation
Edit CONFIG.M4 First In order
Will
> dnl PHP_ARG_ENABLE(redis, whether to enable redis support,> dnl Make sure that the comment is aligned:> dnl [ --enable-redis Enable redis support])
Revision changed to
< PHP_ARG_ENABLE(redis, whether to enable redis support,< [ --enable-redis Enable redis support])
Save exit
Then edit REDIS.C
Add one line of code in this paragraph: Php_fe (Say_hello, NULL)
const zend_function_entry redis_functions[] = { PHP_FE(say_hello, NULL) PHP_FE(confirm_redis_compiled, NULL) /* For testing, remove later. */ PHP_FE_END /* Must be the last line in redis_functions[] */};
Add the following code at the end of the file:
PHP_FUNCTION(say_hello){ zend_printf("hello redis!");}
Save exit
Last edited Php_redis.h
Add one line of code in this paragraph: php_function (Say_hello)
PHP_FUNCTION(confirm_redis_compiled); /* For testing, remove later. */PHP_FUNCTION(say_hello); /* For testing, remove later. */
Save exit
No accident at this time can execute phpize command, no error, problem solving!
Phpize build PHP Extension error cannot find CONFIG.M4.