<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></title> 
<link>http://jackxiang.com/index.php</link> 
<description><![CDATA[赢在IT，Playin' with IT,Focus on Killer Application,Marketing Meets Technology.]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[向东博客 专注WEB应用 构架之美 --- 构架之美，在于尽态极妍 | 应用之美，在于药到病除]]></copyright>
<item>
<link>http://jackxiang.com/post//</link>
<title><![CDATA[[个人原创]php msg_get_queue创造或附在一个消息队列上,进行简单的队列分发。]]></title> 
<author>jack &lt;xdy108@126.com&gt;</author>
<category><![CDATA[Php/Js/Shell/Go]]></category>
<pubDate>Sun, 04 Dec 2011 04:06:01 +0000</pubDate> 
<guid>http://jackxiang.com/post//</guid> 
<description>
<![CDATA[ 
	Jack&#039;s Note：<br/>共享内存再顺带提一下消息队列Message Queue（也是在System V IPC函数组中），消息队列似乎可以视为另一种共享内存，只是数据存储的方式有些不同。简单来说，就是每个key对应一个队列，每个队列可以保存多个数据，数据间按照先进先出的原则进行操作。<br/>这个简单的方式，健壮性超过大多的 免费MQ server，限制是只能在Unix下用<br/>Linux编译php时option加上--enable-sysvmsg<br/>PHP编译Configure如下：<br/><textarea name="code" class="html" rows="15" cols="100">
./configure --prefix=/usr/local/webserver/php --with-config-file-path=/usr/local/webserver/php/etc --with-mysql=/usr/local/webserver/mysql --with-mysqli=/usr/local/webserver/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring&nbsp;&nbsp;--with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --enable-sysvmsg
</textarea><br/>出现编译问题如下：<br/><textarea name="code" class="html" rows="15" cols="100">
/usr/bin/ld: cannot find -lltdl
collect2: ld returned 1 exit status
</textarea><br/>php在make过程中出现“usr bin ld cannot find lltdl”错误，详细错误如下：<br/>/usr/bin/ld: cannot find -lltdl<br/>collect2: ld returned 1 exit status<br/>make: *** [libphp5.la] Error 1<br/>在Google上搜了好久，终于找到答案，原来是在编辑php时添加的“–with-mcrypt”选项造成[上面的编译暂时去掉了–with-mcrypt就Ok了]。所以“usr bin ld cannot find lltdl”错误解决办法如下：<br/>1、如果不需要mcrypt，那么编辑php时去掉该选项，然后再make、make install。<br/>2、如果需要mcrypt，那么需要安装libltdl<br/>libltdl在libmcrypt软件包中就有，具体过程：<br/><textarea name="code" class="html" rows="15" cols="100">
cd /root/software/libmcrypt-2.5.8/libltdl
./configure --enable-ltdl-install
make;make install
</textarea><br/>经过测试，果然去掉“–with-mcrypt”选项编译通过。<br/>send.php <br/><textarea name="code" class="html" rows="15" cols="100">
&lt;?php
$ip = msg_get_queue(12340);
msg_send($ip,2,&quot;Jack&#039;sTest Message&quot;,false,false,$err);
?&gt;
</textarea><br/>Receive.php<br/><textarea name="code" class="html" rows="15" cols="100">
&lt;?php
&lt;?php
$ip = msg_get_queue(12340);
while(msg_receive($ip,0,$msgtype,4000,$data,false,null,$err))
echo &quot;msgtype &#123;$msgtype&#125; data &#123;$data&#125;:&#123;$err&#125;&#92;n&quot;;
?&gt;
</textarea>
]]>
</description>
</item><item>
<link>http://jackxiang.com/post//#blogcomment</link>
<title><![CDATA[[评论] [个人原创]php msg_get_queue创造或附在一个消息队列上,进行简单的队列分发。]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://jackxiang.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>