phpize php拡張Cannot find configを確立する.m4

2515 ワード

phpize php拡張Cannot find configを確立する.m4 [root@ns root]# phpize
  Cannot find config.m4.
  Make sure that you run/usr/local/bin/phpize in the top level source directory of the module
/usr/local/src/php-4.3.5/extでこのツールを見つけます
php拡張のフレームワークを構築します
  [root@ns ext]#cd/usr/local/src/php-4.3.5/ext/
  [root@ns ext]# ./ext_skel --extname=sdomain
To use your new extension, you will have to execute the following steps:
  1. $ cd ..
  2. $ vi ext/sdomain/config.m4
  3. $ ./buildconf
  4. $ ./configure --[with|enable]-sdomain
  5. $ make
  6. $ ./php -f ext/sdomain/sdomain.php
  7. $ vi ext/sdomain/sdomain.c
  8. $ make [root@ns ext]# cd sdomain/
  [root@ns sdomain]# ls
  config.m4 EXPERIMENTAL     sdomain.php  tests
  CREDITS  sdomain.c php_sdomain.h
ファイルの順序を変更するには
  configue.m4
  sdomain.c
  php_sdomain.hテキストエディタでconfigを開く.m 4ファイル、ファイル内容を変更する:
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])
変更
  PHP_ARG_WITH(my_module, for my_module support,
  [ --with-my_module       Include my_module support])
または
dnl PHP_ARG_ENABLE(my_module, whether to enable my_module support,
  dnl Make sure that the comment is aligned:
  dnl [ --enable-my_module      Enable my_module support])
変更
  PHP_ARG_ENABLE(my_module, whether to enable my_module support,
  [ --enable-my_module      Enable my_module support])
(実はこの部分のdnlを削除して、この書類の中でdnlは注釈の意味で、私たちのPHPの中の#あるいは//に相当して彼の中間の1つの描写術も削除します)
保存して終了
編集
  Vi my_module.c
ファイル内の次のコードを変更します./* Every user visible function must have an entry in my_module_functions[].
*/
function_entry my_module_functions[] = {
    PHP_FE(say_hello,    NULL) /* ? */
    PHP_FE(confirm_my_module_compiled,   NULL) /* For testing, remove later. */
    {NULL, NULL, NULL}   /* Must be the last line in my_module_functions[] */
};

ファイルの最後に次のコードを追加します.PHP_FUNCTION(say_hello)
{
    zend_printf("hello sdomain!");
}

 
再修正:php_sdomain.h
vi php_sdomain.h
PHP_FUNCTION( confirm_my_module_compiled );/* For testing, remove later. */この行の下に行を追加します.PHP_FUNCTION(say_hello); /* For testing, remove later. */
ファイルを保存して終了
このディレクトリの下で上のコマンドを使用できます
  /usr/local/php/bin/phpize