Lua is an embeddable scripting language. If you are trying to embed it in PHP follow this instructions that may help you:
$ sudo apt-get install liblua5.1-0-dev
$ git clone git://repo.or.cz/phplua.git src
$ cd src/
$ phpize
$ ./configureAt this point you are almost done, BUT please edit the file Makefile and change the line:
LUA_SHARED_LIBADD = -lluaby:
LUA_SHARED_LIBADD = -llua5.1Then is time to finish cooking:$ make
$ sudo make installlua.ini
extension=lua.soAlmost done, do a test:
php test.php
$lua=new lua();
$lua->test="Hello World!\n";
$lua->evaluate("print(test)");
转自:http://blog.youkuaiyun.com/pihizi/article/details/5916502
本文详细介绍了如何在PHP环境中成功嵌入Lua脚本,并通过简单的测试脚本来验证其功能。
94

被折叠的 条评论
为什么被折叠?



