我一直试图编译带有ZTS支持的PHP,但没有结果。我试过以下几篇文章,但这篇似乎完全符合我的要求-
https://www.digitalocean.com/community/questions/enable-zts-support-on-ubuntu-14-04
但是,我就是不能让这件事发生。
如果我编译源代码时没有任何变化,它就会编译得很好。一旦我执行以下步骤-
找到以CONFIG_CONFIG=--build=$(DEB_BUILD_GNU_TYPE)\开头的部分,并添加以下配置标志: -启用-维护者-zts\-启用-线程\ 然后,我们希望增加包的版本号,使其高于存储库中的PHP版本。运行dch -i并创建一个新的changelog条目: php5 (5.5.9+dfsg-1 ubuntu4.5+zts1)可信;urgency=medium
我得到以下输出(只显示错误开始出现的地方)-
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实例上尝试过这一点,并且始终遇到相同的问题。
我显然做错了什么,但我不知道是什么。有人知道问题出在哪里吗?
发布于 2015-10-30 00:34:04
抱歉反应太晚了。为了让任何人在搜索中发现这一点,我最终使用了一个CentOS实例,并且PHP第一次工作。
发布于 2016-02-18 19:38:33
好吧,所以我花了一整天的时间来解决这个问题,但是在任何地方都找不到有效的解决方案。改变操作系统对我来说有点太激进了,所以我选择了这条路。它将允许您对某些脚本使用可选的php5-zts。我也跳过了所有与芒果相关的步骤,所以我不能说它们是否有效。然而,应从2016年2月19日起对本指南进行若干重要调整,否则将无法奏效。
1)当前主线程分支的目标是php7,而不是
git clone https://github.com/krakjoe/pthreads.git跑
git clone https://github.com/krakjoe/pthreads.git --branch PHP5 --single-branch否则您的构建尝试将失败。
2)第一次运行make命令时,它可能会失败,因为源目录中没有"makefile“。老实说,我不知道应该使用哪一种,所以我不得不猜测它是"Makefile.global":
cd /usr/local/src/php-5.6.12
./buildconf --force
make -f Makefile.global clean所有后续的调用都会记住makefile,因此您不必再次指定它。
3)最后作者搞乱了ln语法,参数的顺序应该颠倒:
ln -s /usr/local/src/php-5.6.12/sapi/cli/php /usr/bin/php5-zts除此之外,这是一个伟大的向导,拯救了我的日子。
PS:在日期扩展中似乎隐藏了一些错误,因为即使在我使用这个方法成功地使用这个方法构建了php之后,我仍然会收到php警告,并且这个扩展名在最初的文章中会出现致命错误。
发布于 2015-08-27 15:26:23
我解决了这个问题
sudo dpkg-reconfigure tzdata您需要选择本地时区并重试所有。
https://stackoverflow.com/questions/30001606
复制相似问题