<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[沧海一粟]]></title> 
<link>http://www.dzhope.com/index.php</link> 
<description><![CDATA[Web系统架构与服务器运维,php开发]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[沧海一粟]]></copyright>
<item>
<link>http://www.dzhope.com/post//</link>
<title><![CDATA[nginx模块LuaJIT编译安装问题解决]]></title> 
<author>jed &lt;jed521@163.com&gt;</author>
<category><![CDATA[服务器技术]]></category>
<pubDate>Mon, 15 Jul 2013 06:06:24 +0000</pubDate> 
<guid>http://www.dzhope.com/post//</guid> 
<description>
<![CDATA[ 
	环境：<br/>nginx-1.2.7.tar.gz<br/>LuaJIT-2.0.1.tar.gz<br/> <br/>按照正常流程对LuaJIT-2.0.1.tar.gz编译，make;make install<br/>编译nginx<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export LUAJIT_LIB=/usr/local/lib<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export LUAJIT_INC=/usr/local/include/luajit-2.0<br/>&nbsp;&nbsp;./configure --prefix=/usr/local/nginx --add-module=exp/lua-nginx-module/&nbsp;&nbsp; 其他模块参数略<br/> <br/>此时会报告错误<br/>checking for LuaJIT library in /usr/local/lib and /usr/local/include/luajit-2.0 (specified by the LUAJIT_LIB and LUAJIT_INC env) ... not found<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;./configure: error: the ngx_lua addon requires the lua or luajit library and LUAJIT_LIB is defined as /usr/local/lib and LUAJIT_INC /usr/local/include/luajit-2.0, but we cannot find LuaJIT there.<br/> <br/>但是查看相应目录及文件都存在，对错误细节内容追踪，在 objs/autoconf.err 中包含<br/> <br/>>> ----------------------------------------<br/>>>&nbsp;&nbsp; checking for LuaJIT library in /usr/local/lib and<br/>>> /usr/local/include/luajit-2.0 (specified by the LUAJIT_LIB and LUAJIT_INC<br/>>> env)<br/>>><br/>>>&nbsp;&nbsp; /usr/local/lib/libluajit-5.1.a(lj_clib.o): In function `lj_clib_unload':<br/>>>&nbsp;&nbsp; lj_clib.c:(.text+0x9d): undefined reference to `dlclose'<br/>>>&nbsp;&nbsp; /usr/local/lib/libluajit-5.1.a(lj_clib.o): In function `clib_error_':<br/>>>&nbsp;&nbsp; lj_clib.c:(.text+0xb5): undefined reference to `dlerror'<br/>>>&nbsp;&nbsp; /usr/local/lib/libluajit-5.1.a(lj_clib.o): In function `lj_clib_load':<br/>>>&nbsp;&nbsp; lj_clib.c:(.text+0x1bf): undefined reference to `dlopen'<br/>>>&nbsp;&nbsp; lj_clib.c:(.text+0x214): undefined reference to `dlerror'<br/>>>&nbsp;&nbsp; lj_clib.c:(.text+0x2ec): undefined reference to `dlopen'<br/>>>&nbsp;&nbsp; lj_clib.c:(.text+0x2fd): undefined reference to `dlerror'<br/>>>&nbsp;&nbsp; /usr/local/lib/libluajit-5.1.a(lj_clib.o): In function `lj_clib_index':<br/>>>&nbsp;&nbsp; lj_clib.c:(.text+0x47e): undefined reference to `dlsym'<br/>>>&nbsp;&nbsp; collect2: ld 返回 1<br/> <br/>通过该提示，可以在 configure 后追加 --with-ld-opt=-ldl 解决编译问题，并能顺利通过，但是不建议自己指定-ldl选项，因为会导致其他问题。<br/>那能否不指定这个选择，顺利完成编译呢？<br/>通过对LuaJIT编译过程分析，发现LuaJIT在编译中未找到ldconfig，分析为此原因导致<br/>编辑 Makefile文件，找到ldconfig位置（75行） <br/>原内容是：LDCONFIG= ldconfig -n <br/>修改为：LDCONFIG= /sbin/ldconfig -n<br/> <br/>然后对LuaJIT重新make install<br/> <br/>此时再编译nginx，一切顺利
]]>
</description>
</item><item>
<link>http://www.dzhope.com/post//#blogcomment</link>
<title><![CDATA[[评论] nginx模块LuaJIT编译安装问题解决]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.dzhope.com/post//#blogcomment</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>