Closed alinikkhah closed 6 years ago
I'll introduce a new major version of JSMin to support PHP 7.
The feature/php7 branch is compiling fine with VC14 on Windows. php_jsmin.dll will be included in my builds on https://www.apachelounge.com/viewtopic.php?t=6359 today (CET).
It may compile fine, but usage seg faults. It appears to be a memory issue with some of the utf8 code reading javascript.
still nada on centos. Can't compile.
usr/local/src/pecl-jsmin/php_jsmin.c: In function ‘zif_jsmin’: /usr/local/src/pecl-jsmin/php_jsmin.c:122:63: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3 ZVAL_STRINGL(return_value, jmo->buffer.c, jmo->buffer.len, 1); ^ /usr/local/src/pecl-jsmin/php_jsmin.c:122:3: error: ‘ZVAL_STRINGL’ undeclared (first use in this function) ZVAL_STRINGL(return_value, jmo->buffer.c, jmo->buffer.len, 1); ^ /usr/local/src/pecl-jsmin/php_jsmin.c:122:3: note: each undeclared identifier is reported only once for each function it appears in /usr/local/src/pecl-jsmin/php_jsmin.c: In function ‘zif_jsmin_last_error_msg’: /usr/local/src/pecl-jsmin/php_jsmin.c:151:43: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1 RETURN_STRING("Unterminated comment", 1); ^ /usr/local/src/pecl-jsmin/php_jsmin.c:151:4: error: ‘RETURN_STRING’ undeclared (first use in this function) RETURN_STRING("Unterminated comment", 1); ^ /usr/local/src/pecl-jsmin/php_jsmin.c:154:50: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1 RETURN_STRING("Unterminated string literal", 1); ^ /usr/local/src/pecl-jsmin/php_jsmin.c:157:69: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1 RETURN_STRING("Unterminated set in Regular Expression literal", 1); ^ /usr/local/src/pecl-jsmin/php_jsmin.c:160:31: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1 RETURN_STRING("No error", 1); ^ make: *** [php_jsmin.lo] Error 1
Pull request #48 fixes the segfault issue for me.
Any news?
My system: Ubuntu 16.04, PHP-dev 7.0 Help me. I'm trying to install jsmin and get an error
running: make /bin/bash /tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/libtool --mode=compile cc -I. -I/tmp/pear/temp/jsmin -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/include -I/tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/main -I/tmp/pear/temp/jsmin -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/temp/jsmin/utf8.c -o utf8.lo libtool: compile: cc -I. -I/tmp/pear/temp/jsmin -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/include -I/tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/main -I/tmp/pear/temp/jsmin -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/temp/jsmin/utf8.c -fPIC -DPIC -o .libs/utf8.o /bin/bash /tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/libtool --mode=compile cc -I. -I/tmp/pear/temp/jsmin -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/include -I/tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/main -I/tmp/pear/temp/jsmin -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/temp/jsmin/php_jsmin.c -o php_jsmin.lo libtool: compile: cc -I. -I/tmp/pear/temp/jsmin -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/include -I/tmp/pear/temp/pear-build-rootBqpc2w/jsmin-2.0.1/main -I/tmp/pear/temp/jsmin -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/temp/jsmin/php_jsmin.c -fPIC -DPIC -o .libs/php_jsmin.o In file included from /tmp/pear/temp/jsmin/php_jsmin.c:27:0: /tmp/pear/temp/jsmin/jsmin.h:7:40: fatal error: ext/standard/php_smart_str.h: No such file or directory compilation terminated. Makefile:196: recipe for target 'php_jsmin.lo' failed make: *** [php_jsmin.lo] Error 1 ERROR: `make' failed
@Hubaxis7 Did you use the PHP7 branch? https://github.com/sqmk/pecl-jsmin/tree/feature/php7 git clone -b feature/php7 https://github.com/sqmk/pecl-jsmin.git
Thank you very helpful!
Is there is more work required to package and move this to official pecl.php.net package repositiory? pecl install jsmin still pulls in older version which does not build. And its latest version is 2.0.1 So perhaps 3.0.0 need to be released officially?
Publish on pecl as 3.0. Thank you!
Does not work with php 7. Initially, it was not building, but pull-request #42 fixes those build errors.
When #42 is applied, jsmin will build, but I get a segmentation fault when using it.