您的位置:首页 > 编程语言 > Lua

Howto: install phplua extension for PHP

2011-12-04 00:39 399 查看
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
$ ./configure


At this point you are almost done, BUT please edit the file Makefile and change the line:

LUA_SHARED_LIBADD = -llua
by:

LUA_SHARED_LIBADD = -llua5.1
Then is time to finish cooking:
$ make
$ sudo make install
lua.ini

extension=lua.so
Almost done, do a test:

php test.php

$lua=new lua();
$lua->test="Hello World!\n";
$lua->evaluate("print(test)");


转自:http://blog.csdn.net/pihizi/article/details/5916502
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: