{"id":27333,"date":"2024-11-24T19:16:26","date_gmt":"2024-11-24T11:16:26","guid":{"rendered":"https:\/\/fwq.ai\/blog\/?p=27333"},"modified":"2024-11-24T19:16:26","modified_gmt":"2024-11-24T11:16:26","slug":"php%e5%ae%89%e8%a3%85-amqp%e6%89%a9%e5%b1%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/27333\/","title":{"rendered":"PHP\u5b89\u88c5 AMQP\u6269\u5c55"},"content":{"rendered":"<header class=\"entry-header\">\n<h1 class=\"entry-title\">PHP\u5b89\u88c5 AMQP\u6269\u5c55<\/h1>\n<\/header>\n<div class=\"entry-content\">\n<p>AMQP\u6269\u5c55\u80fd\u591f\u652f\u6301rabbitMQ\uff0cAMQP\u662frabbitMQ\u7684\u534f\u8bae\uff08Advanced Message Queue Protocol \u9ad8\u7ea7\u6d88\u606f\u961f\u5217\u534f\u8bae\uff09\u8fd9\u4e2a\u53ef\u81ea\u884c\u767e\u5ea6\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><strong>1\u3001\u5b89\u88c5rabbitmq-c-0.8.0<\/strong><\/p>\n<p>\u4e3a\u4ec0\u4e48\u8981\u5b89\u88c5\u8fd9\u4e2a\uff0c\u4e0d\u77e5\u9053\u539f\u56e0\uff0cPHP\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0a\u662f\u600e\u4e48\u8bf4\u6ef4\u3002<\/p>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/github.com\/alanxz\/rabbitmq-c\/releases\/download\/v0.8.0\/rabbitmq-c-0.8.0.tar.gz<\/p>\n<pre class=\"p1\"><span class=\"s1\">cd rabbitmq-c-0.8.0\r\n<\/span>.\/configure --prefix=\/usr\/local\/rabbitmq-c\r\nmake\r\nmake install<\/pre>\n<p><strong>2\u3001\u5b89\u88c5amqp<\/strong><\/p>\n<p>\u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/pecl.php.net\/package\/amqp<\/p>\n<pre># cd\u00a0amqp-1.7.1\r\n# phpize\r\n# .\/configure --with-php-config=\/usr\/local\/php7\/bin\/php-config --with-amqp --with-librabbitmq-dir=\/usr\/local\/rabbitmq-c\/\r\n# make\r\n# make install\r\n\r\nInstalling shared extensions: \u00a0 \u00a0 \/usr\/local\/php7\/lib\/php\/extensions\/no-debug-non-zts-20151012\/<\/pre>\n<p>\u7f16\u8bd1\u8fc7\u7a0b\u51fa\u73b0\u4e0b\u9762\u7684\u63d0\u793a\u8bf7\u5ffd\u7565.<\/p>\n<pre class=\"p1\"><span class=\"s1\">appending configuration tag \"CXX\" to libtool\r\n<\/span>configure: creating .\/config.status\r\nconfig.status: creating config.h\r\nconfig.status: config.h is unchanged<\/pre>\n<p>\u5728\/usr\/local\/php7\/lib\/php\/extensions\/no-debug-non-zts-20151012\/ \u76ee\u5f55\u4e0b\u6709\u4e2aamqp.so<\/p>\n<p>\u5728php.ini\u7684\u5c3e\u90e8\u6dfb\u52a0<\/p>\n<pre class=\"p1\"><span class=\"s1\">extension=<\/span><span class=\"s2\">amqp.so<\/span><\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>PHP\u5b89\u88c5 AMQP\u6269\u5c55 AMQP\u6269\u5c55\u80fd\u591f\u652f\u6301rabbitMQ\uff0cAMQP\u662frabbitMQ\u7684\u534f\u8bae\uff08Advanced Message Queue Protocol \u9ad8\u7ea7\u6d88\u606f\u961f\u5217\u534f\u8bae\uff09\u8fd9\u4e2a\u53ef\u81ea\u884c\u767e\u5ea6\u3002 &nbsp; 1\u3001\u5b89\u88c5rabbitmq-c-0.8.0 \u4e3a\u4ec0\u4e48\u8981\u5b89\u88c5\u8fd9\u4e2a\uff0c\u4e0d\u77e5\u9053\u539f\u56e0\uff0cPHP\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0a\u662f\u600e\u4e48\u8bf4\u6ef4\u3002 \u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/github.com\/alanxz\/rabbitmq-c\/releases\/download\/v0.8.0\/rabbitmq-c-0.8.0.tar.gz cd rabbitmq-c-0.8.0 .\/configure &#8211;prefix=\/usr\/local\/rabbitmq-c make make install 2\u3001\u5b89\u88c5amqp \u4e0b\u8f7d\u5730\u5740\uff1ahttps:\/\/pecl.php.net\/package\/amqp # cd\u00a0amqp-1.7.1 # phpize # .\/configure &#8211;with-php-config=\/usr\/local\/php7\/bin\/php-config &#8211;with-amqp &#8211;with-librabbitmq-dir=\/usr\/local\/rabbitmq-c\/ # make # make install Installing shared extensions: \u00a0 \u00a0 \/usr\/local\/php7\/lib\/php\/extensions\/no-debug-non-zts-20151012\/ \u7f16\u8bd1\u8fc7\u7a0b\u51fa\u73b0\u4e0b\u9762\u7684\u63d0\u793a\u8bf7\u5ffd\u7565. appending configuration tag &#8220;CXX&#8221; to libtool configure: creating .\/config.status config.status: creating config.h config.status: config.h [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-27333","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=27333"}],"version-history":[{"count":1,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27333\/revisions"}],"predecessor-version":[{"id":27340,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/27333\/revisions\/27340"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=27333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=27333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=27333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}