php-sha3自从升级到5.4后无法正常工作

时间:2014-01-20 21:25:15

标签: php apache ubuntu-12.04 sha-3

我将PHP安装升级为:

 PHP Version 5.4.23-1+sury.org~precise+1

它破坏了我https://github.com/strawbrary/php-sha3的安装。我试着重新编译它,但没有运气。我在php.ini文件中链接了文件。我的phpinfo()没有显示sha3安装的任何迹象。

当我在编译sha3时在服务器上运行phpize时,我得到:

Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626

然而,当我看到我的phpinfo文件时,我得到了:

PHP API         20100412
PHP Extension   20100525
Zend Extension  220100525

以下是我重新编译插件的方法:

    root@deff:/# git clone https://github.com/strawbrary/php-sha3
Cloning into 'php-sha3'...
remote: Reusing existing pack: 42, done.
remote: Total 42 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (42/42), done.
root@deff:/# cd php-sha3/
root@deff:/php-sha3# phpize
Configuring for:
PHP Api Version:         20090626
Zend Module Api No:      20090626
Zend Extension Api No:   220090626
root@deff:/php-sha3# ./configure --enable-sha3
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
checking for PHP extension directory... /usr/lib/php5/20090626+lfs
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking Whether to enable SHA3 support... yes, shared
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) nawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
root@deff:/php-sha3# make
/bin/bash /php-sha3/libtool --mode=compile cc  -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/php_sha3.c -o php_sha3.lo 
libtool: compile:  cc -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/php_sha3.c  -fPIC -DPIC -o .libs/php_sha3.o
In file included from /usr/include/php5/main/php.h:33:0,
                 from /php-sha3/php_sha3.c:5:
/usr/include/php5/main/php_config.h:2126:0: warning: "PACKAGE_NAME" redefined [enabled by default]
/php-sha3/config.h:48:0: note: this is the location of the previous definition
/usr/include/php5/main/php_config.h:2138:0: warning: "PACKAGE_VERSION" redefined [enabled by default]
/php-sha3/config.h:60:0: note: this is the location of the previous definition
In file included from /usr/include/php5/ext/hash/php_hash_types.h:25:0,
                 from /usr/include/php5/ext/hash/php_hash.h:25,
                 from /php-sha3/php_sha3.c:7:
./config.h:48:0: warning: "PACKAGE_NAME" redefined [enabled by default]
/usr/include/php5/main/../main/php_config.h:2126:0: note: this is the location of the previous definition
./config.h:60:0: warning: "PACKAGE_VERSION" redefined [enabled by default]
/usr/include/php5/main/../main/php_config.h:2138:0: note: this is the location of the previous definition
/bin/bash /php-sha3/libtool --mode=compile cc  -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/KeccakNISTInterface.c -o KeccakNISTInterface.lo 
libtool: compile:  cc -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/KeccakNISTInterface.c  -fPIC -DPIC -o .libs/KeccakNISTInterface.o
/bin/bash /php-sha3/libtool --mode=compile cc  -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/KeccakSponge.c -o KeccakSponge.lo 
libtool: compile:  cc -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/KeccakSponge.c  -fPIC -DPIC -o .libs/KeccakSponge.o
/bin/bash /php-sha3/libtool --mode=compile cc  -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/KeccakF-1600-opt64.c -o KeccakF-1600-opt64.lo 
ILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -c /php-sha3/KeccakF-1600-opt64.c -o KeccakF-1600-opt64.lo 
libtool: compile:  cc -I. -I/php-sha3 -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/KeccakF-1600-opt64.c  -fPIC -DPIC -o .libs/KeccakF-1600-opt64.o
r/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /php-sha3/KeccakF-1600-opt64.c  -fPIC -DPIC -o .libs/KeccakF-1600-opt64.o
/bin/bash /php-sha3/libtool --mode=link cc -DPHP_ATOM_INC -I/php-sha3/include -I/php-sha3/main -I/php-sha3 -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -DHAVE_CONFIG_H  -g -O2   -o sha3.la -export-dynamic -avoid-version -prefer-pic -module -rpath /php-sha3/modules  php_sha3.lo KeccakNISTInterface.lo KeccakSponge.lo KeccakF-1600-opt64.lo 
libtool: link: cc -shared  -fPIC -DPIC  .libs/php_sha3.o .libs/KeccakNISTInterface.o .libs/KeccakSponge.o .libs/KeccakF-1600-opt64.o    -O2   -Wl,-soname -Wl,sha3.so -o .libs/sha3.so
libtool: link: ( cd ".libs" && rm -f "sha3.la" && ln -s "../sha3.la" "sha3.la" )
/bin/bash /php-sha3/libtool --mode=install cp ./sha3.la /php-sha3/modules
libtool: install: cp ./.libs/sha3.so /php-sha3/modules/sha3.so
libtool: install: cp ./.libs/sha3.lai /php-sha3/modules/sha3.la
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin" ldconfig -n /php-sha3/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /php-sha3/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

root@deff:/php-sha3# make install
Installing shared extensions:     /usr/lib/php5/20090626+lfs/
root@deff:/php-sha3# sudo apachectl restart

1 个答案:

答案 0 :(得分:0)

安装PHP版本5.4.23-1 + sury.org~precision + 1时出现问题。我与php API版本不匹配。被警告。不要更新到版本5.4.23-1 + sury.org~precision + 1。尝试从官方的php存储库更新。