广告
返回顶部
首页 > 资讯 > 后端开发 > PHP编程 >宝塔PHP安装amqp扩展
  • 619
分享到

宝塔PHP安装amqp扩展

phprabbitmq开发语言 2023-09-07 15:09:36 619人浏览 独家记忆
摘要

宝塔PHP安装aMQp扩展 这篇文章是搬得别人的,因为在我应用的时候完全参考原文章,复制般的操作下来就成功了,实在是幸运,觉得很有用就抄写一遍,以备以后用,如果作者看到了,我在这里表示对您的感谢!如果

宝塔PHP安装aMQp扩展

这篇文章是搬得别人的,因为在我应用的时候完全参考原文章,复制般的操作下来就成功了,实在是幸运,觉得很有用就抄写一遍,以备以后用,如果作者看到了,我在这里表示对您的感谢!如果侵犯了您的权益,您私信我删除。

安装RabbitMQ-c

在安装amqp之前还需要安装另外一个通讯扩展rabbitmq-c。

下载源代码

最新源代码地址可以从GitHub获取,这里用的是v0.10.0版本

wget https://github.com/alanxz/rabbitmq-c/arcHive/v0.10.0.zip
解压源代码并转到源代码目录
unzip v0.10.0.zip && cd rabbitmq-c-0.10.0
让cmake根据CMakeList.txt创建Makefile文件
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/rabbitmq-c 

执行结果

-- The C compiler identification is GNU 4.8.5-- 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-- CMAKE_BUILD_TYPE not specified. Creating Release build-- Found C inline keyWord: inline-- Looking for getaddrinfo-- Looking for getaddrinfo - found-- Looking for Socket-- Looking for socket - found-- Looking for poll-- Looking for poll - found-- Looking for clock_gettime in rt-- Looking for clock_gettime in rt - found-- Looking for posix_spawnp in rt-- Looking for posix_spawnp in rt - found-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found suitable version "1.0.2k", minimum required is "0.9.8")-- Looking for include file pthread.h-- Looking for include file pthread.h - found-- Looking for pthread_create-- Looking for pthread_create - not found-- Looking for pthread_create in pthreads-- Looking for pthread_create in pthreads - not found-- Looking for pthread_create in pthread-- Looking for pthread_create in pthread - found-- Found Threads: TRUE-- PerfORMing Test HAVE_GNU90-- Performing Test HAVE_GNU90 - Success-- Could NOT find POPT (missing:  POPT_INCLUDE_DIR POPT_LIBRARY)-- Could NOT find XMLTO (missing:  XMLTO_EXECUTABLE)-- Could NOT find Doxygen (missing:  DOXYGEN_EXECUTABLE)-- Building rabbitmq as a shared library - yes-- Building rabbitmq as a static library - yes-- Configuring done-- Generating done-- Build files have been written to: /root/rabbitmq-c-0.10.0
开始编译rabbitmq-c库
cmake --build . --target install

执行结果

Scanning dependencies of target rabbitmq[  1%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_framing.c.o[  2%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_api.c.o[  4%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_connection.c.o[  5%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_mem.c.o[  7%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_socket.c.o[  8%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_table.c.o[ 10%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_url.c.o[ 11%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_tcp_socket.c.o[ 13%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_time.c.o[ 14%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_consumer.c.o[ 15%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_openssl.c.o[ 17%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_openssl_hostname_validation.c.o[ 18%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_hostcheck.c.o[ 20%] Building C object librabbitmq/CMakeFiles/rabbitmq.dir/amqp_openssl_bio.c.oLinking C shared library librabbitmq.so[ 20%] Built target rabbitmqScanning dependencies of target rabbitmq-static[ 21%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_framing.c.o[ 23%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_api.c.o[ 24%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_connection.c.o[ 26%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_mem.c.o[ 27%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_socket.c.o[ 28%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_table.c.o[ 30%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_url.c.o[ 31%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_tcp_socket.c.o[ 33%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_time.c.o[ 34%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_consumer.c.o[ 36%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_openssl.c.o[ 37%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_openssl_hostname_validation.c.o[ 39%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_hostcheck.c.o[ 40%] Building C object librabbitmq/CMakeFiles/rabbitmq-static.dir/amqp_openssl_bio.c.oLinking C static library librabbitmq.a[ 40%] Built target rabbitmq-staticScanning dependencies of target amqp_bind[ 42%] Building C object examples/CMakeFiles/amqp_bind.dir/amqp_bind.c.o[ 43%] Building C object examples/CMakeFiles/amqp_bind.dir/utils.c.o[ 44%] Building C object examples/CMakeFiles/amqp_bind.dir/unix/platform_utils.c.oLinking C executable amqp_bind[ 44%] Built target amqp_bindScanning dependencies of target amqp_connect_timeout[ 46%] Building C object examples/CMakeFiles/amqp_connect_timeout.dir/amqp_connect_timeout.c.o[ 47%] Building C object examples/CMakeFiles/amqp_connect_timeout.dir/utils.c.o[ 49%] Building C object examples/CMakeFiles/amqp_connect_timeout.dir/unix/platform_utils.c.oLinking C executable amqp_connect_timeout[ 49%] Built target amqp_connect_timeoutScanning dependencies of target amqp_consumer[ 50%] Building C object examples/CMakeFiles/amqp_consumer.dir/amqp_consumer.c.o[ 52%] Building C object examples/CMakeFiles/amqp_consumer.dir/utils.c.o[ 53%] Building C object examples/CMakeFiles/amqp_consumer.dir/unix/platform_utils.c.oLinking C executable amqp_consumer[ 53%] Built target amqp_consumerScanning dependencies of target amqp_exchange_declare[ 55%] Building C object examples/CMakeFiles/amqp_exchange_declare.dir/amqp_exchange_declare.c.o[ 56%] Building C object examples/CMakeFiles/amqp_exchange_declare.dir/utils.c.o[ 57%] Building C object examples/CMakeFiles/amqp_exchange_declare.dir/unix/platform_utils.c.oLinking C executable amqp_exchange_declare[ 57%] Built target amqp_exchange_declareScanning dependencies of target amqp_listen[ 59%] Building C object examples/CMakeFiles/amqp_listen.dir/amqp_listen.c.o[ 60%] Building C object examples/CMakeFiles/amqp_listen.dir/utils.c.o[ 62%] Building C object examples/CMakeFiles/amqp_listen.dir/unix/platform_utils.c.oLinking C executable amqp_listen[ 62%] Built target amqp_listenScanning dependencies of target amqp_listenq[ 63%] Building C object examples/CMakeFiles/amqp_listenq.dir/amqp_listenq.c.o[ 65%] Building C object examples/CMakeFiles/amqp_listenq.dir/utils.c.o[ 66%] Building C object examples/CMakeFiles/amqp_listenq.dir/unix/platform_utils.c.oLinking C executable amqp_listenq[ 66%] Built target amqp_listenqScanning dependencies of target amqp_producer[ 68%] Building C object examples/CMakeFiles/amqp_producer.dir/amqp_producer.c.o[ 69%] Building C object examples/CMakeFiles/amqp_producer.dir/utils.c.o[ 71%] Building C object examples/CMakeFiles/amqp_producer.dir/unix/platform_utils.c.oLinking C executable amqp_producer[ 71%] Built target amqp_producerScanning dependencies of target amqp_rpc_sendstring_client[ 72%] Building C object examples/CMakeFiles/amqp_rpc_sendstring_client.dir/amqp_rpc_sendstring_client.c.o[ 73%] Building C object examples/CMakeFiles/amqp_rpc_sendstring_client.dir/utils.c.o[ 75%] Building C object examples/CMakeFiles/amqp_rpc_sendstring_client.dir/unix/platform_utils.c.oLinking C executable amqp_rpc_sendstring_client[ 75%] Built target amqp_rpc_sendstring_clientScanning dependencies of target amqp_sendstring[ 76%] Building C object examples/CMakeFiles/amqp_sendstring.dir/amqp_sendstring.c.o[ 78%] Building C object examples/CMakeFiles/amqp_sendstring.dir/utils.c.o[ 79%] Building C object examples/CMakeFiles/amqp_sendstring.dir/unix/platform_utils.c.oLinking C executable amqp_sendstring[ 79%] Built target amqp_sendstringScanning dependencies of target amqp_ssl_connect[ 81%] Building C object examples/CMakeFiles/amqp_ssl_connect.dir/amqp_ssl_connect.c.o[ 82%] Building C object examples/CMakeFiles/amqp_ssl_connect.dir/utils.c.o[ 84%] Building C object examples/CMakeFiles/amqp_ssl_connect.dir/unix/platform_utils.c.oLinking C executable amqp_ssl_connect[ 84%] Built target amqp_ssl_connectScanning dependencies of target amqp_unbind[ 85%] Building C object examples/CMakeFiles/amqp_unbind.dir/amqp_unbind.c.o[ 86%] Building C object examples/CMakeFiles/amqp_unbind.dir/utils.c.o[ 88%] Building C object examples/CMakeFiles/amqp_unbind.dir/unix/platform_utils.c.oLinking C executable amqp_unbind[ 88%] Built target amqp_unbindScanning dependencies of target test_basic[ 89%] Building C object tests/CMakeFiles/test_basic.dir/test_basic.c.oLinking C executable test_basic[ 89%] Built target test_basicScanning dependencies of target test_hostcheck[ 91%] Building C object tests/CMakeFiles/test_hostcheck.dir/test_hostcheck.c.o[ 92%] Building C object tests/CMakeFiles/test_hostcheck.dir/__/librabbitmq/amqp_hostcheck.c.oLinking C executable test_hostcheck[ 92%] Built target test_hostcheckScanning dependencies of target test_merge_capabilities[ 94%] Building C object tests/CMakeFiles/test_merge_capabilities.dir/test_merge_capabilities.c.oLinking C executable test_merge_capabilities[ 94%] Built target test_merge_capabilitiesScanning dependencies of target test_parse_url[ 95%] Building C object tests/CMakeFiles/test_parse_url.dir/test_parse_url.c.oLinking C executable test_parse_url[ 95%] Built target test_parse_urlScanning dependencies of target test_sasl_mechanism[ 97%] Building C object tests/CMakeFiles/test_sasl_mechanism.dir/test_sasl_mechanism.c.oLinking C executable test_sasl_mechanism[ 97%] Built target test_sasl_mechanismScanning dependencies of target test_status_enum[ 98%] Building C object tests/CMakeFiles/test_status_enum.dir/test_status_enum.c.oLinking C executable test_status_enum[ 98%] Built target test_status_enumScanning dependencies of target test_tables[100%] Building C object tests/CMakeFiles/test_tables.dir/test_tables.c.oLinking C executable test_tables[100%] Built target test_tablesInstall the project...-- Install configuration: "Release"-- Installing: /usr/local/rabbitmq-c/lib64/pkGConfig/librabbitmq.pc-- Installing: /usr/local/rabbitmq-c/lib64/librabbitmq.so.4.4.0-- Installing: /usr/local/rabbitmq-c/lib64/librabbitmq.so.4-- Installing: /usr/local/rabbitmq-c/lib64/librabbitmq.so-- Installing: /usr/local/rabbitmq-c/lib64/librabbitmq.a-- Installing: /usr/local/rabbitmq-c/include/amqp.h-- Installing: /usr/local/rabbitmq-c/include/amqp_framing.h-- Installing: /usr/local/rabbitmq-c/include/amqp_tcp_socket.h-- Installing: /usr/local/rabbitmq-c/include/amqp_ssl_socket.h
到这里就已经安装完成了rabbitmq-c。不过这里有一个坑。需要设置软链接

你可以看一下/usr/local/rabbitmq-c下的目录只有include和lib64。因为后面编译安装amqp扩展的时候系统会到/usr/local/rabbitmq-c/lib目录下搜索依赖库,导致错误。所以这里需要加一步

ln -s /usr/local/rabbitmq-c/lib64 /usr/local/rabbitmq-c/lib

安装amqp扩展

下载源代码

最新源代码地址可以从php Pecl获取,这里用的是v1.9.4版本(发布本教程时最新版)

wget Http://pecl.php.net/get/amqp-1.9.4.tgz
解压源代码并转到源代码目录
tar zxvf amqp-1.9.4.tgz && cd amqp-1.9.4
phpize

phpize 命令是用来准备 PHP 扩展库的编译环境的,主要是根据系统信息生成对应的configure文件。
宝塔支持同时使用多个PHP版本,所以注意这里的路径(/www/server/php/73/bin/phpize),换成你要添加的PHP版本对应的路径。

/www/server/php/70/bin/phpize
配置编译参数

宝塔支持同时使用多个PHP版本,这里的路径,换成自己要用到的PHP版本对应的路径(/www/server/php/70/bin/php-config)。

./configure --with-php-config=/www/server/php/70/bin/php-config --with-amqp --with-librabbitmq-dir=/usr/local/rabbitmq-c

执行结果

checking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking for a sed that does not truncate output... /usr/bin/sedchecking for cc... ccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables...checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether cc accepts -g... yeschecking for cc option to accept ISO C89... none neededchecking how to run the C preprocessor... cc -Echecking for icc... nochecking for suncc... nochecking whether cc understands -c and -o together... yeschecking for system library directory... libchecking if compiler supports -R... nochecking if compiler supports -Wl,-rpath,... yeschecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuchecking for PHP prefix... /www/server/php/73checking for PHP includes... -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/libchecking for PHP extension directory... /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731checking for PHP installed headers prefix... /www/server/php/73/include/phpchecking if debug is enabled... nochecking if zts is enabled... nochecking for re2c... noconfigure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.checking for gawk... gawkchecking for amqp support... yes, sharedchecking for amqp... yes, sharedchecking for supported PHP versions... supported (7.3.13)yeschecking for pkg-config... /usr/bin/pkg-configchecking for amqp files in default path... found in /usr/local/rabbitmq-cchecking for librabbitmq version... 0.10.0checking for ld used by cc... /usr/bin/ldchecking if the linker (/usr/bin/ld) is GNU ld... yeschecking for /usr/bin/ld option to reload object files... -rchecking for BSD-compatible nm... /usr/bin/nm -Bchecking whether ln -s works... yeschecking how to recognize dependent libraries... pass_allchecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking dlfcn.h usability... yeschecking dlfcn.h presence... yeschecking for dlfcn.h... yeschecking the maximum length of command line arguments... 1572864checking command to parse /usr/bin/nm -B output from cc object... okchecking for objdir... .libschecking for ar... archecking for ranlib... ranlibchecking for strip... stripchecking if cc supports -fno-rtti -fno-exceptions... nochecking for cc option to produce PIC... -fPICchecking if cc PIC flag -fPIC works... yeschecking if cc static flag -static works... nochecking if cc supports -c -o file.o... yeschecking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yeschecking whether -lc should be explicitly linked in... nochecking dynamic linker characteristics... GNU/Linux ld.sochecking how to hardcode library paths into programs... immediatechecking whether stripping libraries is possible... yeschecking if libtool supports shared libraries... yeschecking whether to build shared libraries... yeschecking whether to build static libraries... nocreating libtoolappending configuration tag "CXX" to libtoolconfigure: creating ./config.statusconfig.status: creating config.h

如果你执行完和这个结果不一样,例如报错:
checking for amqp files in default path... not found configure: error: Pleas那就要检查你是不是少了什么文件,我开始的时候没有从头开始安装,未安装rabbitmq-c,直接安装amqp,就会报错checking ***** error

开始编译安装
make && make install

如果你这里报错出现:"make: No targets specified and no makefile found.Stop."这样的错误提示,有可能你上一步就失败了,检查一下,或者去这里看看,有没有你需要的*

执行结果

/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp.c -o amqp.lomkdir .libs cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp.c  -fPIC -DPIC -o .libs/amqp.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_type.c -o amqp_type.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_type.c  -fPIC -DPIC -o .libs/amqp_type.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_exchange.c -o amqp_exchange.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_exchange.c  -fPIC -DPIC -o .libs/amqp_exchange.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_queue.c -o amqp_queue.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_queue.c  -fPIC -DPIC -o .libs/amqp_queue.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_connection.c -o amqp_connection.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_connection.c  -fPIC -DPIC -o .libs/amqp_connection.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_connection_resource.c -o amqp_connection_resource.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_connection_resource.c  -fPIC -DPIC -o .libs/amqp_connection_resource.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_channel.c -o amqp_channel.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_channel.c  -fPIC -DPIC -o .libs/amqp_channel.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_envelope.c -o amqp_envelope.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_envelope.c  -fPIC -DPIC -o .libs/amqp_envelope.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_basic_properties.c -o amqp_basic_properties.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_basic_properties.c  -fPIC -DPIC -o .libs/amqp_basic_properties.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_methods_handling.c -o amqp_methods_handling.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_methods_handling.c  -fPIC -DPIC -o .libs/amqp_methods_handling.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_timestamp.c -o amqp_timestamp.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_timestamp.c  -fPIC -DPIC -o .libs/amqp_timestamp.o/bin/sh /root/amqp-1.9.4/libtool --mode=compile cc  -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2   -c /root/amqp-1.9.4/amqp_decimal.c -o amqp_decimal.lo cc -I. -I/root/amqp-1.9.4 -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include -DHAVE_CONFIG_H -g -O2 -c /root/amqp-1.9.4/amqp_decimal.c  -fPIC -DPIC -o .libs/amqp_decimal.o/bin/sh /root/amqp-1.9.4/libtool --mode=link cc -DPHP_ATOM_INC -I/root/amqp-1.9.4/include -I/root/amqp-1.9.4/main -I/root/amqp-1.9.4 -I/www/server/php/73/include/php -I/www/server/php/73/include/php/main -I/www/server/php/73/include/php/TSRM -I/www/server/php/73/include/php/Zend -I/www/server/php/73/include/php/ext -I/www/server/php/73/include/php/ext/date/lib -I/usr/local/rabbitmq-c/include  -DHAVE_CONFIG_H  -g -O2    -o amqp.la -export-dynamic -avoid-version -prefer-pic -module -rpath /root/amqp-1.9.4/modules  amqp.lo amqp_type.lo amqp_exchange.lo amqp_queue.lo amqp_connection.lo amqp_connection_resource.lo amqp_channel.lo amqp_envelope.lo amqp_basic_properties.lo amqp_methods_handling.lo amqp_timestamp.lo amqp_decimal.lo -Wl,-rpath,/usr/local/rabbitmq-c/lib -L/usr/local/rabbitmq-c/lib -lrabbitmqcc -shared  .libs/amqp.o .libs/amqp_type.o .libs/amqp_exchange.o .libs/amqp_queue.o .libs/amqp_connection.o .libs/amqp_connection_resource.o .libs/amqp_channel.o .libs/amqp_envelope.o .libs/amqp_basic_properties.o .libs/amqp_methods_handling.o .libs/amqp_timestamp.o .libs/amqp_decimal.o  -L/usr/local/rabbitmq-c/lib -lrabbitmq  -Wl,-rpath -Wl,/usr/local/rabbitmq-c/lib -Wl,-soname -Wl,amqp.so -o .libs/amqp.socreating amqp.la(cd .libs && rm -f amqp.la && ln -s ../amqp.la amqp.la)/bin/sh /root/amqp-1.9.4/libtool --mode=install cp ./amqp.la /root/amqp-1.9.4/modulescp ./.libs/amqp.so /root/amqp-1.9.4/modules/amqp.socp ./.libs/amqp.lai /root/amqp-1.9.4/modules/amqp.laPATH="$PATH:/sbin" ldconfig -n /root/amqp-1.9.4/modules----------------------------------------------------------------------Libraries have been installed in:   /root/amqp-1.9.4/modulesIf you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify 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 formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------Build complete.Don't forget to run 'make test'.Installing shared extensions:     /www/server/php/73/lib/php/extensions/no-debug-non-zts-20180731/
启用扩展

配置php.ini
大概在配置文件九百多行的位置新建一行,加入以下代码,这个地址是你自己服务器的地址,上一步生成的

extension=/www/server/php/70/lib/php/extensions/no-debug-non-zts-20180731/amqp.so
重启php

重启php-fpm或重载配置

查看phpinfo()

查看phpinfo(),搜索amqp,如果找到基本就是安装成功。
这是我的phpinfo

来源地址:https://blog.csdn.net/Seven_color_rainbow/article/details/127144050

--结束END--

本文标题: 宝塔PHP安装amqp扩展

本文链接: https://www.lsjlt.com/news/398420.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • 宝塔PHP安装amqp扩展
    宝塔PHP安装amqp扩展 这篇文章是搬得别人的,因为在我应用的时候完全参考原文章,复制般的操作下来就成功了,实在是幸运,觉得很有用就抄写一遍,以备以后用,如果作者看到了,我在这里表示对您的感谢!如果...
    99+
    2023-09-07
    php rabbitmq 开发语言
  • 宝塔安装 swoole 扩展
    下载 下载地址 直接下载压缩包到本地 下载完成后,找到你要安装的php版本下的扩展目录,上传压缩包并解压。 例如我要安装到 php8.0 版本上,则路径是 /www/server/php/80/li...
    99+
    2023-09-15
    swoole php 后端
  • 怎么安装php扩展-amqp
    这篇文章主要介绍了怎么安装php扩展-amqp,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获,下面让小编带着大家一起了解一下。php是什么语言php,一个嵌套的缩写名称,是英文超级文本预处理语言(PHP:Hy...
    99+
    2023-06-14
  • 宝塔面板中怎么安装php压缩扩展
    在服务器管理中,宝塔面板是一种相对易用的开源面板,它支持多台服务器的管理和快速搭建各种应用程序。对于需要使用PHP编程的用户,安装PHP压缩扩展可以大大提升应用程序运行效率,并减少服务器资源的占用。以下将介绍如何在宝塔面板中安装PHP压缩扩...
    99+
    2023-05-14
    php 宝塔面板
  • 宝塔面板中如何安装php压缩扩展
    这篇“宝塔面板中如何安装php压缩扩展”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“宝塔面板中如何安装php压缩扩展”文章吧...
    99+
    2023-07-05
  • 宝塔面板安装第三方 PHP 扩展 libsodium sodium
    宝塔面板已经集成了很多 PHP 扩展,但是依然无法满足个别人对其他第三方 PHP 扩展的需求,本文以 sodium 扩展为例教大家如何为宝塔面板 PHP 添加其他第三方扩展。 前言 sodium...
    99+
    2023-09-01
    php 服务器 linux
  • 宝塔面板如何针对PHP8.1安装zip扩展
    方法一:以下是在宝塔面板中针对PHP8.1安装zip扩展的步骤:1.登录到宝塔面板,进入网站后台,点击左侧菜单栏的“PHP管理”。2.在页面中选择要安装zip扩展的PHP版本,如PHP8.1。3.点击扩展模块,然后在搜索框中搜索zip扩展。...
    99+
    2023-08-31
    php 服务器 开发语言
  • php安装xlswriter(宝塔安装)
    说明xlswriter需要php7.0以上版本,7.2,7.3,7.4等版本,配置一样,使用xlswriter版本一样,不同php版本,把下面的版本换自己的php版本就可以,下面以宝塔php7.3为搭建环境 下载xlswriter解压 下载...
    99+
    2023-10-24
    php 服务器 linux
  • 宝塔安装PHP扩展 zip.so(Fatal error:致命错误: Class ‘ZipArchive‘ not found)
    Windows 在php.ini文件中,将extension=php_zip.dll前面的分号“;”去除,然后同样在php.ini文件中,将 zlib.output_compression = Off 改为 zlib.output_comp...
    99+
    2023-09-02
    php 开发语言
  • 宝塔linux面板+thinkphp+php7.4安装pdo_sqlsrv和sqlsrv扩展包
    安装扩展sqlsrv与pdo_sqlsrv步骤 第一步:加入微软源第二步:安装odbc驱动程序第三步:安装php7.4对应的pdo_sqlsrv扩展包第四步:解压缩pdo_sqlsrv扩展包并...
    99+
    2023-09-17
    linux php sqlserver
  • PHP版本安装Suhosin扩展禁用eval函数教程(宝塔面板)
    服务器经常莫名其妙的被入侵一句话木马,这些一句话木马主要就是利用eval函数来达到他们的入侵目的,而eval不是PHP的系统组件函数,所以在php.ini中使用disable_functions禁止掉eval的方法都是错误的!(网上一大批这...
    99+
    2023-10-07
    php 开发语言 apache
  • 宝塔无法安装fileinfo扩展解决办法(小白篇)
    宝塔无法安装fileinfo扩展解决办法(小白篇) 宝塔无法php安装fileinfo扩展的方法:手动安装 重装系统登录宝塔先不要安装其他软件,先设置swap是Linux下的虚拟内存,设置内存后...
    99+
    2023-09-26
    php 服务器 linux
  • 宝塔linux一键安装php
    宝塔linux一键安装php宝塔linux是一个非常方便的服务器管理软件,可以极大地简化服务器管理工作。其中包括安装php,以下是宝塔linux一键安装php的步骤:第一步:登录宝塔面板打开您的网站的宝塔面板,输入正确的用户名和密码进行登录...
    99+
    2023-05-24
  • 宝塔安装php-zip依赖
    早期安装的Php7.3是独立编译zip扩展,后续安装及升级是整合编译的,导致升级后会重复加载zip模块. 为避免这个错误. 后面的PHP就不再单独编译ZIP扩展了。 然后呢,PHP 7.3.8,ZIP...
    99+
    2023-09-08
    php 服务器 开发语言
  • linux 安装 php-amqp rabbitmq-c
    这里需要安装rabbitmq-c和amqp扩展 rabbitmq-c : https://github.com/alanxz/rabbitmq-c/tree/v0.11.0 amqp :  PECL :: Package :: amq...
    99+
    2023-08-31
    java-rabbitmq rabbitmq java
  • CentOS 7 安装宝塔
    哈喽大家好,这篇文章将向大家介绍如何在自己的服务器上安装宝塔。       注意:服务器必须为没有安装过任何软件的纯净环境,如果不是则需要前往控制台重装系统(尤其是安装过Apache/Nginx、MySQL、PHP等)       这里我们...
    99+
    2023-10-23
    centos 服务器 linux
  • php安装扩展
    环境信息:ubuntu18、php7.4-fpm 以安装swoole扩展为例 下载php-dev,其中包含phpize命令 apt install php-dev 下载php扩展,在h...
    99+
    2023-08-31
    php 开发语言 apache
  • 宝塔如何安装ssl
    宝塔安装ssl的方法:下载ssl证书到桌面。解压并选择宝塔对应的Nginx证书文件夹。打开宝塔管理面板。点击左侧菜单栏的“网站”,打开网站管理页面。点击需要进行设置ssl的网站名称,打开设置页面。在对话框中点击左侧“ssl选项”。再点击“其...
    99+
    2022-10-21
  • ubuntu如何安装宝塔
    ubuntu安装宝塔的方法:打开ubuntu系统,进入终端字符界面。输入安装命令,然后有Y按Y即可,安装命令:wget -O install.sh http://download.bt.cn/install/install-ubuntu_6...
    99+
    2022-10-04
  • 宝塔一键安装wordpress
    使用宝塔面板来部署网站是非常方便的,以WordPress网站为例来说: 一般有两种方式安装WordPress网站,第一种是上传网站程序到网站根目录手动安装,另外一种是在宝塔面板后台左侧菜单,找到“WordPress一键部署”,根据提示操作即...
    99+
    2023-09-20
    php 开发语言
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作