Tag Archives: Phpize Run Error

How to Solve Phpize Run Error: Cannot find config.m4

Step1: phpize run error

[root@gadmobe ~]# /usr/local/php-fpm/bin/phpize

Cannot find config.m4. 
Make sure that you run '/usr/local/php/bin/phpize' in the top level source directory of the module

Step2: done!

#Go to the php source code directory
cd /usr/local/src/php-5.6.30/ext/

#Execution
./ext_skel --extname=my_module 


#goto my_module
cd /usr/local/src/php-5.6.30/ext/my_module

#edit
vim config.m4 

#
dnl PHP_ARG_WITH(my_module, for my_module support, 
dnl Make sure that the comment is aligned: 
dnl [ --with-my_module Include my_module support]) 

#modify to
PHP_ARG_WITH(my_module, for my_module support, 
Make sure that the comment is aligned: 
[ --with-my_module Include my_module support]) 


vim /usr/local/src/php-5.6.30/ext/my_module.c

#
/* {{{ my_module_functions[]
 *
 * Every user visible function must have an entry in my_module_functions[].
 */
const zend_function_entry my_module_functions[] = {
        PHP_FE(confirm_my_module_compiled,      NULL)           /* For testing, remove later. */
        PHP_FE_END      /* Must be the last line in my_module_functions[] */
};


#modify to
/* {{{ my_module_functions[]
 *
 * Every user visible function must have an entry in my_module_functions[].
 */
const zend_function_entry my_module_functions[] = {
PHP_FE(say_hello,    NULL) /* ?Add a line of code */
    PHP_FE(confirm_my_module_compiled,   NULL) /* For testing, remove later. */
    {NULL, NULL, NULL}   /* Must be the last line in my_module_functions[] */
};