Howto: install phplua extension for PHP

来源:互联网 发布:桌面日程安排软件推荐 编辑:程序博客网 时间:2024/06/05 10:14

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

原创粉丝点击