0

有没有人在 FreeBSD 上成功安装 Cassandra 的 php 扩展?我从端口安装了 c/c++ 驱动程序......但 php 扩展一直失败。

我按照这里的说明操作: https ://github.com/datastax/php-driver/blob/master/ext/README.md

git clone https://github.com/datastax/php-driver.git
cd php-driver
git submodule update --init
cd ext
./install.sh

这是./install命令的输出

+ rm -Rf /tmp/php-driver-installation
+ mkdir /tmp/php-driver-installation
+ pushd /tmp/php-driver-installation
/tmp/php-driver-installation /tmp/php-driver/ext
+ mkdir build
++ cd build
++ pwd
+ builddir=/tmp/php-driver-installation/build
+ echo 'Compiling cpp-driver...'
Compiling cpp-driver...
+ mkdir cpp-driver
+ pushd cpp-driver
/tmp/php-driver-installation/cpp-driver /tmp/php-driver-installation /tmp/php-driver/ext
+ cmake -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_INSTALL_PREFIX:PATH=/tmp/php-driver-installation/build -DCASS_BUILD_STATIC=ON -DCASS_BUILD_SHARED=OFF -DCMAKE_BUILD_TYPE=RELEASE -DCASS_USE_ZLIB=ON -DCMAKE_INSTALL_LIBDIR:PATH=lib /tmp/php-driver/ext/../lib/cpp-driver/
-- The C compiler identification is Clang 3.4.1
-- The CXX compiler identification is Clang 3.4.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/CC
-- Check for working CXX compiler: /usr/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Project version: 2.6.0
-- Found Libuv: /usr/local/lib/libuv.so
-- Found OpenSSL: /usr/lib/libssl.so;/usr/lib/libcrypto.so (found version "1.0.1s")
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.8")
-- Using std::atomic implementation for atomic operations
-- Checking to see if CXX compiler accepts flag -std=c++11
-- Checking to see if CXX compiler accepts flag -std=c++11 - yes
-- Using hash header <functional> and namespace "std"
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for memcpy
-- Looking for memcpy - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of long long
-- Check size of long long - done
-- Check size of uint16_t
-- Check size of uint16_t - done
-- Check size of u_int16_t
-- Check size of u_int16_t - done
-- Check size of __uint16_t
-- Check size of __uint16_t - done
-- Looking for SO_NOSIGPIPE
-- Looking for SO_NOSIGPIPE - found
-- Looking for sigtimedwait
-- Looking for sigtimedwait - found
-- Found PkgConfig: /usr/local/bin/pkg-config (found version "1.3.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/php-driver-installation/cpp-driver
+ make
Scanning dependencies of target cpp-driver
[  1%] Building CXX object CMakeFiles/cpp-driver.dir/src/abstract_data.cpp.o
[  2%] Building CXX object CMakeFiles/cpp-driver.dir/src/address.cpp.o
[  3%] Building CXX object CMakeFiles/cpp-driver.dir/src/auth.cpp.o
[  5%] Building CXX object CMakeFiles/cpp-driver.dir/src/auth_requests.cpp.o
[  6%] Building CXX object CMakeFiles/cpp-driver.dir/src/auth_responses.cpp.o
[  7%] Building CXX object CMakeFiles/cpp-driver.dir/src/batch_request.cpp.o
[  9%] Building CXX object CMakeFiles/cpp-driver.dir/src/blacklist_dc_policy.cpp.o
[ 10%] Building CXX object CMakeFiles/cpp-driver.dir/src/blacklist_policy.cpp.o
[ 11%] Building CXX object CMakeFiles/cpp-driver.dir/src/cluster.cpp.o
[ 13%] Building CXX object CMakeFiles/cpp-driver.dir/src/collection.cpp.o
[ 14%] Building CXX object CMakeFiles/cpp-driver.dir/src/collection_iterator.cpp.o
[ 15%] Building CXX object CMakeFiles/cpp-driver.dir/src/connection.cpp.o
[ 17%] Building CXX object CMakeFiles/cpp-driver.dir/src/control_connection.cpp.o
[ 18%] Building CXX object CMakeFiles/cpp-driver.dir/src/data_type.cpp.o
[ 19%] Building CXX object CMakeFiles/cpp-driver.dir/src/data_type_parser.cpp.o
[ 21%] Building CXX object CMakeFiles/cpp-driver.dir/src/dc_aware_policy.cpp.o
[ 22%] Building CXX object CMakeFiles/cpp-driver.dir/src/encode.cpp.o
[ 23%] Building CXX object CMakeFiles/cpp-driver.dir/src/error_response.cpp.o
[ 25%] Building CXX object CMakeFiles/cpp-driver.dir/src/event_response.cpp.o
[ 26%] Building CXX object CMakeFiles/cpp-driver.dir/src/execute_request.cpp.o
[ 27%] Building CXX object CMakeFiles/cpp-driver.dir/src/external.cpp.o
[ 28%] Building CXX object CMakeFiles/cpp-driver.dir/src/future.cpp.o
[ 30%] Building CXX object CMakeFiles/cpp-driver.dir/src/get_time-unix.cpp.o
[ 31%] Building CXX object CMakeFiles/cpp-driver.dir/src/host.cpp.o
[ 32%] Building CXX object CMakeFiles/cpp-driver.dir/src/host_targeting_policy.cpp.o
[ 34%] Building CXX object CMakeFiles/cpp-driver.dir/src/io_worker.cpp.o
[ 35%] Building CXX object CMakeFiles/cpp-driver.dir/src/iterator.cpp.o
[ 36%] Building CXX object CMakeFiles/cpp-driver.dir/src/latency_aware_policy.cpp.o
[ 38%] Building CXX object CMakeFiles/cpp-driver.dir/src/list_policy.cpp.o
[ 39%] Building CXX object CMakeFiles/cpp-driver.dir/src/logger.cpp.o
[ 40%] Building CXX object CMakeFiles/cpp-driver.dir/src/map_iterator.cpp.o
[ 42%] Building CXX object CMakeFiles/cpp-driver.dir/src/md5.cpp.o
[ 43%] Building CXX object CMakeFiles/cpp-driver.dir/src/metadata.cpp.o
[ 44%] Building CXX object CMakeFiles/cpp-driver.dir/src/murmur3.cpp.o
[ 46%] Building CXX object CMakeFiles/cpp-driver.dir/src/pool.cpp.o
[ 47%] Building CXX object CMakeFiles/cpp-driver.dir/src/prepare_request.cpp.o
[ 48%] Building CXX object CMakeFiles/cpp-driver.dir/src/prepared.cpp.o
[ 50%] Building CXX object CMakeFiles/cpp-driver.dir/src/query_request.cpp.o
[ 51%] Building CXX object CMakeFiles/cpp-driver.dir/src/random.cpp.o
[ 52%] Building CXX object CMakeFiles/cpp-driver.dir/src/register_request.cpp.o
[ 53%] Building CXX object CMakeFiles/cpp-driver.dir/src/request.cpp.o
[ 55%] Building CXX object CMakeFiles/cpp-driver.dir/src/request_callback.cpp.o
[ 56%] Building CXX object CMakeFiles/cpp-driver.dir/src/request_handler.cpp.o
[ 57%] Building CXX object CMakeFiles/cpp-driver.dir/src/response.cpp.o
[ 59%] Building CXX object CMakeFiles/cpp-driver.dir/src/result_metadata.cpp.o
[ 60%] Building CXX object CMakeFiles/cpp-driver.dir/src/result_response.cpp.o
[ 61%] Building CXX object CMakeFiles/cpp-driver.dir/src/retry_policy.cpp.o
[ 63%] Building CXX object CMakeFiles/cpp-driver.dir/src/ring_buffer.cpp.o
[ 64%] Building CXX object CMakeFiles/cpp-driver.dir/src/round_robin_policy.cpp.o
[ 65%] Building CXX object CMakeFiles/cpp-driver.dir/src/row.cpp.o
[ 67%] Building CXX object CMakeFiles/cpp-driver.dir/src/schema_change_callback.cpp.o
[ 68%] Building CXX object CMakeFiles/cpp-driver.dir/src/session.cpp.o
[ 69%] Building CXX object CMakeFiles/cpp-driver.dir/src/ssl.cpp.o
[ 71%] Building CXX object CMakeFiles/cpp-driver.dir/src/startup_request.cpp.o
[ 72%] Building CXX object CMakeFiles/cpp-driver.dir/src/statement.cpp.o
[ 73%] Building CXX object CMakeFiles/cpp-driver.dir/src/string_ref.cpp.o
[ 75%] Building CXX object CMakeFiles/cpp-driver.dir/src/supported_response.cpp.o
[ 76%] Building CXX object CMakeFiles/cpp-driver.dir/src/testing.cpp.o
[ 77%] Building CXX object CMakeFiles/cpp-driver.dir/src/timestamp_generator.cpp.o
[ 78%] Building CXX object CMakeFiles/cpp-driver.dir/src/token_aware_policy.cpp.o
[ 80%] Building CXX object CMakeFiles/cpp-driver.dir/src/token_map.cpp.o
[ 81%] Building CXX object CMakeFiles/cpp-driver.dir/src/token_map_impl.cpp.o
[ 82%] Building CXX object CMakeFiles/cpp-driver.dir/src/tuple.cpp.o
[ 84%] Building CXX object CMakeFiles/cpp-driver.dir/src/user_type_field_iterator.cpp.o
[ 85%] Building CXX object CMakeFiles/cpp-driver.dir/src/user_type_value.cpp.o
[ 86%] Building CXX object CMakeFiles/cpp-driver.dir/src/utils.cpp.o
[ 88%] Building CXX object CMakeFiles/cpp-driver.dir/src/uuids.cpp.o
[ 89%] Building CXX object CMakeFiles/cpp-driver.dir/src/value.cpp.o
[ 90%] Building CXX object CMakeFiles/cpp-driver.dir/src/whitelist_dc_policy.cpp.o
[ 92%] Building CXX object CMakeFiles/cpp-driver.dir/src/whitelist_policy.cpp.o
[ 93%] Building CXX object CMakeFiles/cpp-driver.dir/src/third_party/hdr_histogram/hdr_histogram.cpp.o
[ 94%] Building CXX object CMakeFiles/cpp-driver.dir/src/third_party/curl/hostcheck.cpp.o
[ 96%] Building CXX object CMakeFiles/cpp-driver.dir/src/ssl/ssl_openssl_impl.cpp.o
[ 97%] Building CXX object CMakeFiles/cpp-driver.dir/src/ssl/ring_buffer_bio.cpp.o
[ 97%] Built target cpp-driver
Scanning dependencies of target cassandra
[ 98%] Linking CXX shared library libcassandra.so
[ 98%] Built target cassandra
Scanning dependencies of target cassandra_static
[100%] Linking CXX static library libcassandra_static.a
[100%] Built target cassandra_static
+ make install
[ 97%] Built target cpp-driver
[ 98%] Built target cassandra
[100%] Built target cassandra_static
Install the project...
-- Install configuration: "RELEASE"
-- Installing: /tmp/php-driver-installation/build/include/cassandra.h
-- Installing: /tmp/php-driver-installation/build/lib/libcassandra.so.2.6.0
-- Installing: /tmp/php-driver-installation/build/lib/libcassandra.so.2
-- Installing: /tmp/php-driver-installation/build/lib/libcassandra.so
-- Set runtime path of "/tmp/php-driver-installation/build/lib/libcassandra.so.2.6.0" to ""
-- Installing: /tmp/php-driver-installation/build/lib/pkgconfig/cassandra.pc
-- Installing: /tmp/php-driver-installation/build/lib/libcassandra_static.a
-- Installing: /tmp/php-driver-installation/build/lib/pkgconfig/cassandra_static.pc
+ popd
/tmp/php-driver-installation /tmp/php-driver/ext
+ rm -Rf cpp-driver
+ rm -f build/lib/libcassandra.dylib build/lib/libcassandra.so
+ mv build/lib/libcassandra_static.a build/lib/libcassandra.a
+ popd
/tmp/php-driver/ext
+ echo 'Compiling and installing the extension...'
Compiling and installing the extension...
+ phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
+ echo ./configure --with-cassandra=/tmp/php-driver-installation/build --with-libdir=lib
./configure --with-cassandra=/tmp/php-driver-installation/build --with-libdir=lib
+ LIBS='-lssl -lz -luv -lm -lstdc++'
+ LDFLAGS=-L/tmp/php-driver-installation/build/lib
+ ./configure --with-cassandra=/tmp/php-driver-installation/build --with-libdir=lib
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for cc... cc
checking whether the C compiler works... no
configure: error: in `/tmp/php-driver/ext':
configure: error: C compiler cannot create executables
See `config.log' for more details

所以它以:

configure: error: in `/tmp/php-driver/ext':
configure: error: C compiler cannot create executables
See `config.log' for more details

以下是 config.log 上的内容:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure --with-cassandra=/tmp/php-driver-installation/build --with-libdir=lib

## --------- ##
## Platform. ##
## --------- ##

hostname = DT2014-WSS-001
uname -m = amd64
uname -r = 10.3-RELEASE-p11
uname -s = FreeBSD
uname -v = FreeBSD 10.3-RELEASE-p11 #0: Mon Oct 24 18:49:24 UTC 2016     root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC 

/usr/bin/uname -p = amd64
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /sbin
PATH: /bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /usr/games
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /root/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2298: checking for grep that handles long lines and -e
configure:2356: result: /usr/bin/grep
configure:2361: checking for egrep
configure:2423: result: /usr/bin/grep -E
configure:2428: checking for a sed that does not truncate output
configure:2482: result: /usr/bin/sed
configure:2614: checking for cc
configure:2630: found /usr/bin/cc
configure:2641: result: cc
configure:2672: checking for C compiler version
configure:2681: cc --version >&5
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.3
Thread model: posix
configure:2692: $? = 0
configure:2681: cc -v >&5
FreeBSD clang version 3.4.1 (tags/RELEASE_34/dot1-final 208032) 20140512
Target: x86_64-unknown-freebsd10.3
Thread model: posix
Selected GCC installation: 
configure:2692: $? = 0
configure:2681: cc -V >&5
cc: error: argument to '-V' is missing (expected 1 value)
cc: error: no input files
configure:2692: $? = 1
configure:2681: cc -qversion >&5
cc: error: unknown argument: '-qversion'
cc: error: no input files
configure:2692: $? = 1
configure:2712: checking whether the C compiler works
configure:2734: cc   -L/tmp/php-driver-installation/build/lib conftest.c -lssl -lz -luv -lm -lstdc++ >&5
/usr/bin/ld: cannot find -luv
cc: error: linker command failed with exit code 1 (use -v to see invocation)
configure:2738: $? = 1
configure:2776: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:2781: error: in `/tmp/php_cassandra_install/php-driver/ext':
configure:2784: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_env_CC_set=''
ac_cv_env_CC_value=''
ac_cv_env_CFLAGS_set=''
ac_cv_env_CFLAGS_value=''
ac_cv_env_CPPFLAGS_set=''
ac_cv_env_CPPFLAGS_value=''
ac_cv_env_CPP_set=''
ac_cv_env_CPP_value=''
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value=-L/tmp/php-driver-installation/build/lib
ac_cv_env_LIBS_set=set
ac_cv_env_LIBS_value='-lssl -lz -luv -lm -lstdc++'
ac_cv_env_build_alias_set=''
ac_cv_env_build_alias_value=''
ac_cv_env_host_alias_set=''
ac_cv_env_host_alias_value=''
ac_cv_env_target_alias_set=''
ac_cv_env_target_alias_value=''
ac_cv_path_EGREP='/usr/bin/grep -E'
ac_cv_path_GREP=/usr/bin/grep
ac_cv_prog_ac_ct_CC=cc
lt_cv_path_SED=/usr/bin/sed

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
AWK=''
CC='cc'
CFLAGS=''
CONFIGURE_COMMAND=' '\''./configure'\''  '\''--with-cassandra=/tmp/php-driver-installation/build'\'' '\''--with-libdir=lib'\'' '\''LDFLAGS=-L/tmp/php-driver-installation/build/lib'\'' '\''LIBS=-lssl '\''-lz'\'' '\''-luv'\'' '\''-lm'\'' '\''-lstdc++'\'''\'''
CONFIGURE_OPTIONS=' '\''--with-cassandra=/tmp/php-driver-installation/build'\'' '\''--with-libdir=lib'\'' '\''LDFLAGS=-L/tmp/php-driver-installation/build/lib'\'' '\''LIBS=-lssl '\''-lz'\'' '\''-luv'\'' '\''-lm'\'' '\''-lstdc++'\'''\'''
CPP=''
CPPFLAGS=''
DEFS=''
DSYMUTIL=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP='/usr/bin/grep -E'
EXEEXT=''
GREP='/usr/bin/grep'
LDFLAGS='-L/tmp/php-driver-installation/build/lib'
LIBOBJS=''
LIBS='-lssl -lz -luv -lm -lstdc++'
LIBTOOL=''
LN_S=''
LTLIBOBJS=''
NMEDIT=''
OBJEXT=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
RE2C=''
SED='/usr/bin/sed'
SHELL='/bin/sh'
SHLIB_DL_SUFFIX_NAME=''
SHLIB_SUFFIX_NAME=''
STRIP=''
ac_ct_CC='cc'
bindir='${exec_prefix}/bin'
build=''
build_alias=''
build_cpu=''
build_os=''
build_vendor=''
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host=''
host_alias=''
host_cpu=''
host_os=''
host_vendor=''
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='NONE'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target=''
target_alias=''
target_cpu=''
target_os=''
target_vendor=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""

configure: exit 77

我也尝试过phpize, ./configure, make install,它在./configure. 这是输出:

# phpize
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
# ./configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/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... amd64-unknown-freebsd10.3
checking host system type... amd64-unknown-freebsd10.3
checking target system type... amd64-unknown-freebsd10.3
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/lib/php/20131226-debug
checking for PHP installed headers prefix... /usr/local/include/php
checking if debug is enabled... yes
checking if zts is enabled... yes
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 Enable Cassandra extension... yes, shared
checking for supported PHP version... supported (5.6.30)
checking libuv install dir... yes, shared
checking GNU MP install dir... yes, shared
checking for __gmp_version in -lgmp... no
configure: error: Unable to load libgmp

我在系统上安装了 GMP 6.1.2,还安装了 php 的 GMP 扩展。所以我不确定为什么它不能加载 libgmp。

任何帮助或建议将不胜感激。

谢谢

4

0 回答 0