PHP下編譯swoole出現configure: error: Cannot find php-config. Please use --with-php-config=PATH

然後斷開了編譯
原因是環境的路徑問題,沒有找到PHP環境中的php-config文件

解決辦法:
【注意:每個人的環境均可能相同,路徑自己替換】

./configure --with-php-config=/www/server/php/72/bin/php-config

其中/www/server/php/72是我的PHP環境路徑,按照自己的替換
如下就是成功了

[root@VM_0_26_centos swoole-4.2.0]# ./configure --with-php-config=/www/server/php/72/bin/php-config
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... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /www/server/php/72
checking for PHP includes... -I/www/server/php/72/include/php -I/www/server/php/72/include/php/main-I/www/server/php/72/include/php/TSRM -I/www/server/php/72/include/php/Zend -I/www/server/php/72/include/php/ext -I/www/server/php/72/include/php/ext/date/lib
checking for PHP extension directory... /www/server/php/72/lib/php/extensions/no-debug-non-zts-20170718
checking for PHP installed headers prefix... /www/server/php/72/include/php
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... gawk
checking whether to enable debug log... no
checking Whether to enable trace log... no
checking enable sockets support... no
checking enable async_redis support... no
checking enable openssl support... no
checking enable http2.0 support... no
checking swoole support... yes, shared
checking enable mysqlnd support... no
checking enable coroutine postgresql support... no
checking dir of openssl... no
checking dir of hiredis... no
checking dir of nghttp2... no
checking dir of php-x... no
checking dir of jemalloc... no
checking dir of libpq... no
checking enable thread support... no
checking enable hugepage support... no
checking whether to enable asan... no
checking enable picohttpparser support... no
checking if compiling with clang... no
checking for cpu affinity... yes
checking for socket REUSEPORT... yes
checking for futex... yes
checking for ucontext... yes
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for boost.context... no
checking for valgrind... no
checking for clock_gettime in -lrt... yes
checking for accept4 in -lc... yes
checking for signalfd in -lc... yes
checking for eventfd in -lc... yes
checking for epoll_create in -lc... yes
checking for poll in -lc... yes
checking for sendfile in -lc... yes
checking for kqueue in -lc... no
checking for backtrace in -lc... yes
checking for daemon in -lc... yes
checking for mkostemp in -lc... yes
checking for inotify_init in -lc... yes
checking for malloc_trim in -lc... yes
checking for inotify_init1 in -lc... yes
checking for gethostbyname2_r in -lc... yes
checking for ptrace in -lc... yes
checking for pthread_rwlock_init in -lpthread... yes
checking for pthread_spin_lock in -lpthread... yes
checking for pthread_mutex_timedlock in -lpthread... yes
checking for pthread_barrier_init in -lpthread... yes
checking for pcre_compile in -lpcre... yes
checking for redisConnect in -lhiredis... no
checking for PQconnectdb in -lpq... no
checking for nghttp2_hd_inflate_new in -lnghttp2... no
checking for BrotliEncoderCreateInstance in -lbrotlienc... no
checking for gzgets in -lz... yes
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking how to run the C++ preprocessor... g++ -E
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
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 dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... g++ -E
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) 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

creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC
checking if g++ PIC flag -fPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... GNU/Linux ld.so
(cached) (cached) checking how to hardcode library paths into programs... immediate
configure: creating ./config.status
config.status: creating config.h
config.status: config.h is unchanged
[root@VM_0_26_centos swoole-4.2.0]#

說明就成功了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章