php构建tokenizer扩展失败

使用phpize构建tokenizer扩展

cd php-8.2.0/ext/tokenizer/
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make

报错

make: *** No rule to make target '/usr/src/php/ext/tokenizer/Zend/zend_language_parser.y', needed by '/usr/src/php/ext/tokenizer/Zend/zend_language_parser.c'.  Stop.

修改php-8.2.0/ext/tokenizer/Makefile.frag

vim php-8.2.0/ext/tokenizer/Makefile.frag

修改内容如下

$(top_srcdir)/ext/tokenizer/tokenizer_data.c: $(top_srcdir)/Zend/zend_language_parser.h
	@if test ! -z "$(PHP)"; then \
		$(PHP) $(srcdir)/tokenizer_data_gen.php; \
	fi;
#$(builddir)/tokenizer.lo: $(top_srcdir)/Zend/zend_language_parser.c $(top_srcdir)/Zend/zend_language_scanner.c

重新构建

cd php-8.2.0/ext/tokenizer/
 ./configure
 make distclean 
 /usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install

检查是否安装成功



你可能感兴趣的:(php,开发语言)