php-7php-extensionphp-ncurses

install ncurses extensions on php7.0


I try install ncurses extensions for php7.0 but I get this error

/bin/bash /tmp/pear/download/ncurses-1.0.2/libtool --mode=compile cc  -I. -I/tmp/pear/download/ncurses-1.0.2 -DPHP_ATOM_INC -I/tmp/pear/download/ncurses-1.0.2/include -I/tmp/pear/download/ncurses-1.0.2/main -I/tmp/pear/download/ncurses-1.0.2 -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/download/ncurses-1.0.2/ncurses.c -o ncurses.lo 
libtool: compile:  cc -I. -I/tmp/pear/download/ncurses-1.0.2 -DPHP_ATOM_INC -I/tmp/pear/download/ncurses-1.0.2/include -I/tmp/pear/download/ncurses-1.0.2/main -I/tmp/pear/download/ncurses-1.0.2 -I/usr/include/php/20151012 -I/usr/include/php/20151012/main -I/usr/include/php/20151012/TSRM -I/usr/include/php/20151012/Zend -I/usr/include/php/20151012/ext -I/usr/include/php/20151012/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/download/ncurses-1.0.2/ncurses.c  -fPIC -DPIC -o .libs/ncurses.o
/tmp/pear/download/ncurses-1.0.2/ncurses.c:36:37: error: unknown type name ‘zend_rsrc_list_entry’
 static void ncurses_destruct_window(zend_rsrc_list_entry *rsrc TSRMLS_DC)
                                     ^
/tmp/pear/download/ncurses-1.0.2/ncurses.c:45:36: error: unknown type name ‘zend_rsrc_list_entry’
 static void ncurses_destruct_panel(zend_rsrc_list_entry *rsrc TSRMLS_DC)
                                    ^
/tmp/pear/download/ncurses-1.0.2/ncurses.c: In function ‘zm_startup_ncurses’:
/tmp/pear/download/ncurses-1.0.2/ncurses.c:247:57: error: ‘ncurses_destruct_window’ undeclared (first use in this function)
  le_ncurses_windows = zend_register_list_destructors_ex(ncurses_destruct_window, NULL, "ncurses_window", module_number);
                                                         ^
/tmp/pear/download/ncurses-1.0.2/ncurses.c:247:57: note: each undeclared identifier is reported only once for each function it appears in
/tmp/pear/download/ncurses-1.0.2/ncurses.c:249:56: error: ‘ncurses_destruct_panel’ undeclared (first use in this function)
  le_ncurses_panels = zend_register_list_destructors_ex(ncurses_destruct_panel, NULL, "ncurses_panel", module_number);
                                                        ^
Makefile:194: ошибка выполнения рецепта для цели «ncurses.lo»
make: *** [ncurses.lo] Ошибка 1

ошибка выполнения рецепта для цели «ncurses.lo» is like error in process run target


Solution

  • I know its an old post, but recently I have the same problem. I try the way that @mark-neyhart says in answer, but using the link that @Boshentz says in comment. And finally I can run ncurses with php8.3.

    I followed these steps:

    cd ~/
    wget https://github.com/OOPS-ORG-PHP/mod_ncurses/archive/refs/heads/master.zip
    unzip ~/master.zip
    cd mod_ncurses-master
    phpize
    ./configure --with-php-config=/usr/local/bin/php-config
    make
    make install
    rm -Rf ~/master ~/channels.xml
    

    the idea is download last master branch from git repository, unzip and follow the same steps that @mark-neyhart says in his answer. More "simply", dont need to patch library, the only is to compile it.

    also, i added a new image in docker-hub, that contains this configuration(if someone needs it):

    jakalagsp/php83-ncurses