【发布时间】:2015-07-12 03:43:18
【问题描述】:
我一直在尝试用 ZTS 支持编译 PHP,但没有成功。我试过关注几篇文章,但这一篇似乎完全符合我的要求 -
https://www.digitalocean.com/community/questions/enable-zts-support-on-ubuntu-14-04
但是,我就是无法正常工作。
如果我编译源代码而不做任何更改,它编译得很好。只要我执行以下步骤 -
找到以 COMMON_CONFIG=--build=$(DEB_BUILD_GNU_TYPE) \ 并添加以下内容 配置标志:
--enable-maintainer-zts \ --enable-pthreads \然后我们想增加包的版本号,这样它就是 高于存储库中的 PHP 版本。运行 dch -i 和 创建一个新的变更日志条目:
php5 (5.5.9+dfsg-1ubuntu4.5+zts1) 值得信赖;紧急=中等
在 ZTS 支持下重建。
-- 你周一,2014 年 11 月 10 日 13:14:32 -0500
我得到以下输出(仅显示错误开始出现的位置)-
libtool: compile: /php5-5.5.9+dfsg/apache2-build/meta_ccld -IZend/ -I/php5-5.5.9+dfsg/Zend/ -DPHP_ATOM_INC -I/php5-5.5.9+dfsg/apache2-build/in clude -I/php5-5.5.9+dfsg/apache2-build/main -I/php5-5.5.9+dfsg -I/php5-5.5.9+dfsg/apache2-build/ext/date/lib -I/php5-5.5.9+dfsg/ext/date/lib -I /php5-5.5.9+dfsg/ext/ereg/regex -I/usr/include/libxml2 -I/usr/include/enchant -I/usr/X11 -I/usr/include/freetype2 -I/usr/include/x86_64-linux-g nu -I/php5-5.5.9+dfsg/ext/mbstring/oniguruma -I/php5-5.5.9+dfsg/apache2-build/ext/mbstring/oniguruma -I/php5-5.5.9+dfsg/ext/mbstring/libmbfl -I /php5-5.5.9+dfsg/apache2-build/ext/mbstring/libmbfl -I/php5-5.5.9+dfsg/ext/mbstring/libmbfl/mbfl -I/php5-5.5.9+dfsg/apache2-build/ext/mbstring/ libmbfl/mbfl -I/usr/include/mysql -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/tidy -I/php5-5.5.9+dfsg/apache2-build/TSRM -I/ php5-5.5.9+dfsg/apache2-build/Zend -I/php5-5.5.9+dfsg/main -I/php5-5.5.9+dfsg/Zend -I/php5-5.5.9+dfsg/TSRM -I/php5-5.5.9+dfsg/apache2-build/ -D _FORTIFY_SOURCE=2 -D_REENTRANT -I/usr/include -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O2 -Wall -fs igned-char -fno-strict-aliasing -g -pthread -DZTS -c /php5-5.5.9+dfsg/Zend/zend.c -fPIC -DPIC -o Zend/.libs/zend.o
/php5-5.5.9+dfsg/Zend/zend.c: In function 'zend_error':
/php5-5.5.9+dfsg/Zend/zend.c:1043:28: warning: 'error_lineno' may be used uninitialized in this function [-Wmaybe-uninitialized]
active_opline->lineno = error_lineno;
^
echo "# Generated by Makefile for libtool" > Zend/zend_dtrace.d.lo
if CFLAGS="-I/usr/include -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O2 -Wall -fsigned-char -fno-stri ct-aliasing -g -pthread -DZTS" dtrace -G -o Zend/.libs/zend_dtrace.d.o -s /php5-5.5.9+dfsg/Zend/zend_dtrace.d main/.libs/main.o Zend/.libs/zen d_API.o Zend/.libs/zend_execute.o Zend/.libs/zend_exceptions.o Zend/.libs/zend_dtrace.o Zend/.libs/zend.o 2> /dev/null && test -f "Zend/.libs/z end_dtrace.d.o"; then \
echo "pic_object='.libs/zend_dtrace.d.o'" >> Zend/zend_dtrace.d.lo ;\
else \
echo "pic_object='none'" >> Zend/zend_dtrace.d.lo ;\
fi
if CFLAGS="-I/usr/include -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O2 -Wall -fsigned-char -fno-stri ct-aliasing -g -pthread -DZTS" dtrace -G -o Zend/zend_dtrace.d.o -s /php5-5.5.9+dfsg/Zend/zend_dtrace.d main/main.o Zend/zend_API.o Zend/zend_e xecute.o Zend/zend_exceptions.o Zend/zend_dtrace.o Zend/zend.o 2> /dev/null && test -f "Zend/zend_dtrace.d.o"; then \
echo "non_pic_object='zend_dtrace.d.o'" >> Zend/zend_dtrace.d.lo ;\
else \
echo "non_pic_object='none'" >> Zend/zend_dtrace.d.lo ;\
fi
/bin/bash /php5-5.5.9+dfsg/apache2-build/libtool --preserve-dup-deps --mode=compile /php5-5.5.9+dfsg/apache2-build/meta_ccld -Iext/date/lib -Ie xt/date/ -I/php5-5.5.9+dfsg/ext/date/ -DPHP_ATOM_INC -I/php5-5.5.9+dfsg/apache2-build/include -I/php5-5.5.9+dfsg/apache2-build/main -I/php5-5.5 .9+dfsg -I/php5-5.5.9+dfsg/apache2-build/ext/date/lib -I/php5-5.5.9+dfsg/ext/date/lib -I/php5-5.5.9+dfsg/ext/ereg/regex -I/usr/include/libxml2 -I/usr/include/enchant -I/usr/X11 -I/usr/include/freetype2 -I/usr/include/x86_64-linux-gnu -I/php5-5.5.9+dfsg/ext/mbstring/oniguruma -I/php5-5. 5.9+dfsg/apache2-build/ext/mbstring/oniguruma -I/php5-5.5.9+dfsg/ext/mbstring/libmbfl -I/php5-5.5.9+dfsg/apache2-build/ext/mbstring/libmbfl -I/ php5-5.5.9+dfsg/ext/mbstring/libmbfl/mbfl -I/php5-5.5.9+dfsg/apache2-build/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/include/postgr esql -I/usr/include/pspell -I/usr/include/tidy -I/php5-5.5.9+dfsg/apache2-build/TSRM -I/php5-5.5.9+dfsg/apache2-build/Zend -I/php5-5.5.9+dfsg/m ain -I/php5-5.5.9+dfsg/Zend -I/php5-5.5.9+dfsg/TSRM -I/php5-5.5.9+dfsg/apache2-build/ -D_FORTIFY_SOURCE=2 -D_REENTRANT -I/usr/include -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -O2 -Wall -fsigned-char -fno-strict-aliasing -g -pthread -DZTS -c /php5-5.5.9+dfsg/ext/date/php_date.c -o ext/date/php_date.lo
libtool: compile: /php5-5.5.9+dfsg/apache2-build/meta_ccld -Iext/date/lib -Iext/date/ -I/php5-5.5.9+dfsg/ext/date/ -DPHP_ATOM_INC -I/php5-5.5. 9+dfsg/apache2-build/include -I/php5-5.5.9+dfsg/apache2-build/main -I/php5-5.5.9+dfsg -I/php5-5.5.9+dfsg/apache2-build/ext/date/lib -I/php5-5.5 .9+dfsg/ext/date/lib -I/php5-5.5.9+dfsg/ext/ereg/regex -I/usr/include/libxml2 -I/usr/include/enchant -I/usr/X11 -I/usr/include/freetype2 -I/usr /include/x86_64-linux-gnu -I/php5-5.5.9+dfsg/ext/mbstring/oniguruma -I/php5-5.5.9+dfsg/apache2-build/ext/mbstring/oniguruma -I/php5-5.5.9+dfsg/ ext/mbstring/libmbfl -I/php5-5.5.9+dfsg/apache2-build/ext/mbstring/libmbfl -I/php5-5.5.9+dfsg/ext/mbstring/libmbfl/mbfl -I/php5-5.5.9+dfsg/apac he2-build/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/include/postgresql -I/usr/include/pspell -I/usr/include/tidy -I/php5-5.5.9+dfsg /apache2-build/TSRM -I/php5-5.5.9+dfsg/apache2-build/Zend -I/php5-5.5.9+dfsg/main -I/php5-5.5.9+dfsg/Zend -I/php5-5.5.9+dfsg/TSRM -I/php5-5.5.9 +dfsg/apache2-build/ -D_FORTIFY_SOURCE=2 -D_REENTRANT -I/usr/include -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format -security -O2 -Wall -fsigned-char -fno-strict-aliasing -g -pthread -DZTS -c /php5-5.5.9+dfsg/ext/date/php_date.c -fPIC -DPIC -o ext/date/.libs /php_date.o
In file included from /php5-5.5.9+dfsg/main/php.h:39:0,
from /php5-5.5.9+dfsg/ext/date/php_date.c:21:
/php5-5.5.9+dfsg/ext/date/php_date.c: In function 'php_date_do_return_parsed_time':
/php5-5.5.9+dfsg/ext/date/php_date.c:2992:71: error: 'TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH' undeclared (first use in this function)
add_assoc_bool(element, parsed_time->relative.first_last_day_of == TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH ? "first_day_of_month" : "last_day_of _month", 1);
^
/php5-5.5.9+dfsg/Zend/zend_API.h:387:68: note: in definition of macro 'add_assoc_bool'
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
^
/php5-5.5.9+dfsg/ext/date/php_date.c:2992:71: note: each undeclared identifier is reported only once for each function it appears in
add_assoc_bool(element, parsed_time->relative.first_last_day_of == TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH ? "first_day_of_month" : "last_day_of _month", 1);
^
/php5-5.5.9+dfsg/Zend/zend_API.h:387:68: note: in definition of macro 'add_assoc_bool'
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
^
/php5-5.5.9+dfsg/ext/date/php_date.c: In function 'php_date_timezone_set':
/php5-5.5.9+dfsg/ext/date/php_date.c:3320:4: warning: implicit declaration of function 'timelib_set_timezone_from_offset' [-Wimplicit-function- declaration]
timelib_set_timezone_from_offset(dateobj->time, tzobj->tzi.utc_offset);
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3323:4: warning: implicit declaration of function 'timelib_set_timezone_from_abbr' [-Wimplicit-function-de claration]
timelib_set_timezone_from_abbr(dateobj->time, tzobj->tzi.z);
^
/php5-5.5.9+dfsg/ext/date/php_date.c: In function 'timezone_initialize':
/php5-5.5.9+dfsg/ext/date/php_date.c:3659:2: warning: implicit declaration of function 'timelib_parse_zone' [-Wimplicit-function-declaration]
dummy_t->z = timelib_parse_zone(&tz, &dst, dummy_t, ¬_found, DATE_TIMEZONEDB, php_date_parse_tzfile_wrapper);
^
/php5-5.5.9+dfsg/ext/date/php_date.c: In function 'zif_timezone_transitions_get':
/php5-5.5.9+dfsg/ext/date/php_date.c:3912:20: error: 'timelib_tzinfo' has no member named 'bit32'
if (tzobj->tzi.tz->bit32.timecnt > 0) {
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3924:34: error: 'timelib_tzinfo' has no member named 'bit32'
} while (begin < tzobj->tzi.tz->bit32.timecnt);
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3929:20: error: 'timelib_tzinfo' has no member named 'bit32'
if (tzobj->tzi.tz->bit32.timecnt > 0) {
^
In file included from /php5-5.5.9+dfsg/main/php.h:39:0,
from /php5-5.5.9+dfsg/ext/date/php_date.c:21:
/php5-5.5.9+dfsg/ext/date/php_date.c:3901:37: error: 'timelib_tzinfo' has no member named 'bit32'
#define add_last() add(tzobj->tzi.tz->bit32.timecnt - 1, timestamp_begin)
^
/php5-5.5.9+dfsg/Zend/zend_API.h:385:92: note: in definition of macro 'add_assoc_long'
#define add_assoc_long(__arg, __key, __n) add_assoc_long_ex(__arg, __key, strlen(__key)+1, __n)
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3901:20: note: in expansion of macro 'add'
#define add_last() add(tzobj->tzi.tz->bit32.timecnt - 1, timestamp_begin)
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3930:4: note: in expansion of macro 'add_last'
add_last();
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3901:37: error: 'timelib_tzinfo' has no member named 'bit32'
#define add_last() add(tzobj->tzi.tz->bit32.timecnt - 1, timestamp_begin)
^
/php5-5.5.9+dfsg/Zend/zend_API.h:387:92: note: in definition of macro 'add_assoc_bool'
#define add_assoc_bool(__arg, __key, __b) add_assoc_bool_ex(__arg, __key, strlen(__key)+1, __b)
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3901:20: note: in expansion of macro 'add'
#define add_last() add(tzobj->tzi.tz->bit32.timecnt - 1, timestamp_begin)
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3930:4: note: in expansion of macro 'add_last'
add_last();
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3901:37: error: 'timelib_tzinfo' has no member named 'bit32'
#define add_last() add(tzobj->tzi.tz->bit32.timecnt - 1, timestamp_begin)
^
/php5-5.5.9+dfsg/Zend/zend_API.h:390:111: note: in definition of macro 'add_assoc_string'
#define add_assoc_string(__arg, __key, __str, __duplicate) add_assoc_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate)
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3901:20: note: in expansion of macro 'add'
#define add_last() add(tzobj->tzi.tz->bit32.timecnt - 1, timestamp_begin)
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3930:4: note: in expansion of macro 'add_last'
add_last();
^
/php5-5.5.9+dfsg/ext/date/php_date.c:3935:36: error: 'timelib_tzinfo' has no member named 'bit32'
for (i = begin; i < tzobj->tzi.tz->bit32.timecnt; ++i) {
^
make[1]: *** [ext/date/php_date.lo] Error 1
make[1]: Leaving directory `/php5-5.5.9+dfsg/apache2-build'
make: *** [build-apache2-stamp] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1364:
dpkg-buildpackage -rfakeroot -D -us -uc failed
我已经不止一次地在一个全新的 EC2 实例上尝试过,并且一直遇到同样的问题。
我显然做错了什么,但我不知道它是什么。有谁知道问题可能是什么?
【问题讨论】:
-
我也有同样的问题。你找到解决办法了吗?
-
我让它在 RaspberryPi 2 / Raspbian 上与 php 5.4.41 一起使用,但在使用 5.5.9 的 Ubuntu 上尝试时遇到了同样的错误。