Howto: install phplua extension for PHP

翟奕
2023-12-01

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

 类似资料:

相关阅读

相关文章

相关问答