在 ubuntu 14.04 上编译支持 ZTS 的 PHP [英] Compile PHP with ZTS support on ubuntu 14.04

查看:39
本文介绍了在 ubuntu 14.04 上编译支持 ZTS 的 PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用 ZTS 支持编译 PHP,但没有成功.我试过关注几篇文章,但这一篇似乎完全符合我的要求 -

I've been trying to compile PHP with ZTS support with no luck. I've tried following a few articles but this one seems to fit my requirements perfectly -

https://www.digitalocean.com/community/questions/enable-zts-support-on-ubuntu-14-04

但是,我无法让它正常工作.

However, I just can't get this working.

如果我不做任何更改地编译源代码,它就可以正常编译.只要我执行以下步骤 -

If I compile the source with no changes, it compiles fine. As soon as I perform the following steps -

找到以开头的部分COMMON_CONFIG=--build=$(DEB_BUILD_GNU_TYPE) \ 并添加以下内容配置标志:

Find the section starting with COMMON_CONFIG=--build=$(DEB_BUILD_GNU_TYPE) \ and add the following configure flags:

        --enable-maintainer-zts \
        --enable-pthreads \

然后我们要增加包的版本号,这样它就是高于存储库中的 PHP 版本.运行 dch -i 和创建一个新的变更日志条目:

Then we want to bump the version number for the package, so that it is higher than the version of PHP in the repository. Run dch -i and create a new changelog entry:

php5 (5.5.9+dfsg-1ubuntu4.5+zts1) 值得信赖;紧迫性=中等

php5 (5.5.9+dfsg-1ubuntu4.5+zts1) trusty; urgency=medium

  • 使用 ZTS 支持重建.

  • Rebuild with ZTS support.

-- 2014 年 11 月 10 日星期一 13:14:32 -0500

-- You Mon, 10 Nov 2014 13:14:32 -0500


我得到以下输出(仅显示错误开始出现的位置)-


I get the following output (only showing where errors started appearing) -

  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, &not_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 实例上尝试过这个,并且始终遇到相同的问题.
我显然做错了什么,但我不知道是什么.有没有人知道可能是什么问题?

I've tried this is on a brand new EC2 instance more than once and consistently get the same issue.
I'm obviously doing something wrong but I have no idea what it is. Does anyone have an idea of what the problem could be?

推荐答案

抱歉回复晚了.为了任何人在搜索中找到它 - 我最终启动了一个 CentOS 实例,并且 PHP 构建第一次运行.

Sorry for the late response. For the sake of anyone finding this in a search - I ended up spinning up a CentOS instance instead and the PHP build worked first time.

这篇关于在 ubuntu 14.04 上编译支持 ZTS 的 PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆