Code Monkey home page Code Monkey logo

php-lua's People

Contributors

aurora avatar hjanuschka avatar laruence avatar mikhainin avatar remicollet avatar sgolemon avatar tony2001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-lua's Issues

Installation fails on Ubuntu

Hi,

I'm trying to install the extension on Ubuntu Trusty 64 and I'm getting the following error:

$ pecl install pecl/lua-1.1.0
downloading lua-1.1.0.tgz ...
Starting to download lua-1.1.0.tgz (14,896 bytes)
.....done: 14,896 bytes
9 source files, building
running: phpize
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212
building in /tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0
running: /tmp/pear/temp/lua/configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib
checking for PHP extension directory... /usr/lib/php5/20121212
checking for PHP installed headers prefix... /usr/include/php5
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for lua support... yes, shared
checking for lua in default path... found in /usr/local
checking for lua library in default path... found in /usr/lib
checking how to print strings... printf
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... (cached) gawk
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/bash /tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/lua -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/include -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/main -I/tmp/pear/temp/lua -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/lua/lua.c -o lua.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/lua -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/include -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/main -I/tmp/pear/temp/lua -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/lua/lua.c  -fPIC -DPIC -o .libs/lua.o
/bin/bash /tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/libtool --mode=compile cc  -I. -I/tmp/pear/temp/lua -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/include -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/main -I/tmp/pear/temp/lua -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -c /tmp/pear/temp/lua/lua_closure.c -o lua_closure.lo
libtool: compile:  cc -I. -I/tmp/pear/temp/lua -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/include -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/main -I/tmp/pear/temp/lua -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/lua/lua_closure.c  -fPIC -DPIC -o .libs/lua_closure.o
/bin/bash /tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/libtool --mode=link cc -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/include -I/tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/main -I/tmp/pear/temp/lua -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -I/usr/local/include  -DHAVE_CONFIG_H  -g -O2   -o lua.la -export-dynamic -avoid-version -prefer-pic -module -rpath /tmp/pear/temp/pear-build-roota89ZpL/lua-1.1.0/modules  lua.lo lua_closure.lo -llua
libtool: link: cc -shared  -fPIC -DPIC  .libs/lua.o .libs/lua_closure.o   -llua  -O2   -Wl,-soname -Wl,lua.so -o .libs/lua.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblua.a(lapi.o): relocation R_X86_64_32 against `luaO_nilobject_' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../lib/liblua.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [lua.la] Error 1
ERROR: `make' failed

This is my current configuration:

$ lua -v
Lua 5.3.2  Copyright (C) 1994-2015 Lua.org, PUC-Rio
$ php -v
PHP 5.5.9-1ubuntu4.16 (cli) (built: Apr 20 2016 14:31:27)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

I installed lua from source as explained on the official page, run make linux install and symlinked the files in /usr/local/lib and /usr/local/include since the install script could not find the lua libraries.

Am I doing anything wrong?

Thanks for your help

Problem with private properties in sub-classes

I am sometimes extending the Lua class to provide additional functionality. One problem i have is, that "private" properties of the sub-class are treated like properties of the Lua class which leads to the problem, that the values stored in them get lost. The following code for example prints "NULL":

class a extends Lua {
}

class b extends a {
    private $val = 'lua';

    public function test() {
        var_dump($this->val);
    }
}

$b = new b();
$b->test();

I understand, that this happens to "protected" and "public" properties of class b, but shouldn't be the "private" properties treated different?

segment fault

When lua print a table data structure, php script get segment fault

gdb bt:
#0 0x00007fa952d91a67 in ?? () from /usr/lib64/liblua-5.1.so
#1 0x00007fa952d8489c in lua_next () from /usr/lib64/liblua-5.1.so
#2 0x00007fa952fad835 in php_lua_get_zval_from_lua () from /opt/remi/php71/root/usr/lib64/php/modules/lua.so
#3 0x00007fa952fad932 in ?? () from /opt/remi/php71/root/usr/lib64/php/modules/lua.so
#4 0x00007fa952d895d1 in ?? () from /usr/lib64/liblua-5.1.so
#5 0x00007fa952d94249 in ?? () from /usr/lib64/liblua-5.1.so
#6 0x00007fa952d89a9d in ?? () from /usr/lib64/liblua-5.1.so
#7 0x00007fa952d89137 in ?? () from /usr/lib64/liblua-5.1.so
#8 0x00007fa952d891b2 in ?? () from /usr/lib64/liblua-5.1.so
#9 0x00007fa952d84b61 in lua_pcall () from /usr/lib64/liblua-5.1.so
#10 0x00007fa952fae2a3 in zim_lua_eval () from /opt/remi/php71/root/usr/lib64/php/modules/lua.so
#11 0x000000000066e368 in ?? ()
#12 0x000000000064d1d8 in execute_ex ()
#13 0x00000000005e3720 in zend_call_function ()
#14 0x00000000004e49ff in ?? ()
#15 0x000000000066e368 in ?? ()
#16 0x000000000064d1d8 in execute_ex ()
#17 0x000000000066e6eb in ?? ()
#18 0x000000000064d1d8 in execute_ex ()
#19 0x0000000000699130 in zend_execute ()
#20 0x00000000005f12b3 in zend_execute_scripts ()
#21 0x000000000058f8f0 in php_execute_script ()
#22 0x000000000069c43a in ?? ()
#23 0x000000000069cc3a in ?? ()
#24 0x00007fa963ccdd5d in __libc_start_main () from /lib64/libc.so.6
#25 0x000000000042ae21 in _start ()

Error installing on Mac OS

I get this error when trying to install:

pecl install lua
checking for lua support... yes, shared
checking to specify a custom lua version... yes, shared
checking to specify a custom lua version... yes, shared
checking for lua in default path... found in /usr/local
checking for lua library in default path... not found
configure: error: Please reinstall the lua distribution - lua library should be in <lua-dir>/lib/
ERROR: `/private/tmp/pear/temp/lua/configure --with-php-config=/usr/local/opt/php/bin/php-config' failed

I have installed lua with homebrew brew install lua it is available in version 5.3.5

Lua is available at /usr/local/include/lua/lua.h

~ $ cd /usr/local/include/lua
lua $ ls -l
total 120
-rw-r--r--  1 marvin  staff   8632 26 Jun  2018 lauxlib.h
-rw-r--r--  1 marvin  staff  14837 26 Jun  2018 lua.h
-rw-r--r--  1 marvin  staff    191 26 Jun  2018 lua.hpp
-rw-r--r--  1 marvin  staff  21644  8 Jun 23:35 luaconf.h
-rw-r--r--  1 marvin  staff   1305 26 Jun  2018 lualib.h

And library at /usr/local/lib/liblua.dylib

lua $ ls -l /usr/local/lib/ | grep lua
lrwxr-xr-x    1 marvin  admin    44  8 Jun 23:35 liblua.5.3.5.dylib -> ../Cellar/lua/5.3.5_1/lib/liblua.5.3.5.dylib
lrwxr-xr-x    1 marvin  admin    42  8 Jun 23:35 liblua.5.3.dylib -> ../Cellar/lua/5.3.5_1/lib/liblua.5.3.dylib
lrwxr-xr-x    1 marvin  admin    38  8 Jun 23:35 liblua.dylib -> ../Cellar/lua/5.3.5_1/lib/liblua.dylib
lrwxr-xr-x    1 marvin  admin    41  8 Jun 23:35 liblua5.3.dylib -> ../Cellar/lua/5.3.5_1/lib/liblua5.3.dylib

PHP Version 7.3.4 and Mac OS Version 10.14.4

Boolean FALSE is always TRUE

$lua = new Lua(); $lua->assign('TEST', false); $result = $lua->eval('return TEST'); var_dump($result);

This incorrectly returns bool(true)

This also happens when returning value from PHP functions using RegisterCallback

Omission from changelog

Hey guys,

Is there a changelog anywhere? I found the one on PECL, but it doesn't list the change from triggering errors to throwing exceptions in lua.c between 1.0.0 and 1.1.0.

If there isn't another, it would be cool to have one in with the code.

Thanks,

Joe

PHP worked with Lua failed

Hello laruence,
I just install php lua on my env by following the document https://github.com/nolka/php-lua-install-script.

  • Lighttpd 1.4.3 is used as server.
  • PHP 7.0.16-4+deb.sury.org~trusty+1
  • Lua 5.2.1

I have created a php file named "upload.php".
Content is:

eval(<<

When I access this page through web browser http://localhost/uploader.php
I get errors in lighttpd/error.log:
2017-03-15 06:11:05: (mod_fastcgi.c.2673) FastCGI-stderr: PHP message: PHP Fatal error: Uncaught Error: Class 'Lua' not found in /var/www/uploader.php:2
2017-03-15 06:11:05: (mod_fastcgi.c.2673) FastCGI-stderr: Stack trace:
2017-03-15 06:11:05: (mod_fastcgi.c.2673) FastCGI-stderr: #0 {main}
2017-03-15 06:11:05: (mod_fastcgi.c.2673) FastCGI-stderr: thrown in /var/www/uploader.php on line 2
It seems the lua can't be parsed.

BTW, when I run command 'php -m|grep lua' , there is a "lua" be shown.

Could you help me to find what is wrong?~~~

php 7.0.8 Segmentation faults

[ 7160.978673] traps: php[1197] general protection ip:7f2c77cc5eae sp:7ffe44c64a10 error:0 in liblua5.3.so.0.0.0[7f2c77cb0000+35000] [ 7329.306544] traps: php[5597] general protection ip:7fd50d8c5eae sp:7fff4bb9f8a0 error:0 in liblua5.3.so.0.0.0[7fd50d8b0000+35000] [ 7526.096608] traps: php[7753] general protection ip:7f68462c5eae sp:7ffc8061ad20 error:0 in liblua5.3.so.0.0.0[7f68462b0000+35000] [ 8449.318540] traps: php[10576] general protection ip:7f2891ac5eae sp:7fff650441d0 error:0 in liblua5.3.so.0.0.0[7f2891ab0000+35000] [ 8918.139754] traps: php[12736] general protection ip:7fa14f8c5eae sp:7ffea00fb1d0 error:0 in liblua5.3.so.0.0.0[7fa14f8b0000+35000] [ 9903.623422] traps: php[15253] general protection ip:7fbc9eac5eae sp:7ffeffead5c0 error:0 in liblua5.3.so.0.0.0[7fbc9eab0000+35000] [11121.292869] traps: php[23359] general protection ip:7fe780ac5eae sp:7fff89aca970 error:0 in liblua5.3.so.0.0.0[7fe780ab0000+35000]

Limit loaded lua modules

In the construct of the Lua class the following is called
luaL_openlibs(L);

This loads all available lua libs. I want to be able to not load the OS and IO lib because I'm trying to create a secure sandbox to run third party code that should not be able to access anything else than the PHP methods I expose.

Could you create a way to limit the Lua modules to load?

assert() and error() in Lua module loaded by custom package loader raise exception in closure

I am trying to use php-lua with a custom package loader loading lua scripts and modules from a remote server. I ran into an issue with assert and error inside my modules. When an assert throws or when I call the Lua error function, php-lua raises an exception:

call to lua function (null) failed
#0 [internal function]: LuaClosure->__invoke()
#1 [internal function]: LuaClosure->__invoke()
#2 /path/to/bug-assert.php(34): Lua->eval('local m = requi...')
#3 {main}

I attached a test case showing this problem. The test case installs a custom package loader load_package which tells Lua to call the PHP run_script function (which in my real application fetches code from a remote server) when a module is required. run_script loads a module which exposes a single function func containing asserts. When the main script calls func any assert that doesn't pass will throw a LuaClosure exception. Same for when the function calls error. If I move the assert to the module's main context, it works as expected.

I tested the 1.1.0 release from PECL and the master branch on GitHub.

bug-assert.phpt

call lua function failed: attempt to call a table value

When i call lua function with use_self=True, i got this error: call to lua function attempt to call a table value failed

php code example:
$lua = new Lua();
$lua->include('battleEntryServer/BattleEntry.lua');
$lua->call(array('G_BattleChecker', 'RunOneBattle'), [], true))

lua code example:
battleEntryServer/BattleEntry.lua:
G_BattleChecker = require('battleEntryServer.BattleChecker').new()

battleEntryServer/BattleChecker.lua:
local BattleChecker = class('BattleChecker')
function BattleChecker:RunOneBattle(){

}

Problem with laravel

Hello laruence,

I'm pretty new to the linux world but I gave it a try at installing php-lua in order to play with some lua scripts in laravel.

I create a simple php file :
$lua = new Lua();
$lua->assign("php_var", array(1=>1, 2, 3));
var_dump($lua->php_var);

If I launch it from linux terminal, I get the correct output.

When trying the same code inside a laravel class, I get the following message : "Class 'Lua' not found".

Do you know if there is some extra setup steps required to make it work with laravel ? I added extension=lua.so to php.ini file.

Thank you !

php_lua-1.1.0-5.5-ts-vc11-x86 NOT working on php 5.5.38

php 5.5.38 + apache (using phpStudy Enviroment)

I tested php_lua-2.0.5-7.2-nts-vc15-x86, and it works very well on php php-7.2.10-nts.

And there is nothing related lua inside phpinfo.php.

Have you ever test php_lua-1.1.0-5.5-ts-vc11-x86?
What's your php version?

Error in MAC system, MAC vesion:OS X El Capitan 10.11.6 ,Lua vesion:lua 5.3.2

                                                           ^

/Users/huangjianfeng/Downloads/lua-2.0.2/lua-2.0.2/lua.c:820:24: warning:
incompatible pointer types assigning to 'zend_object_value
(_)(zend_class_entry *)' (aka 'struct zend_object_value ()(struct
_zend_class_entry _)') from 'zend_object *(zend_class_entry *)' (aka
'struct _zend_object *(struct _zend_class_entry *)')
[-Wincompatible-pointer-types]
lua_ce->create_object = php_lua_create_object;
^ ~~~~~~~~~~~~~~~~~~~~~
/Users/huangjianfeng/Downloads/lua-2.0.2/lua-2.0.2/lua.c:822:22: error: no
member named 'offset' in 'struct zend_object_handlers'
lua_object_handlers.offset = XtOffsetOf(php_lua_object, obj);
~~~~~~~~~~~~~~~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
26 warnings and 20 errors generated.
make: *
* [lua.lo] Error 1

Modules installation

Hello,

I'm trying to install 1.1.0 version via peck utility in latest CentOS 6.5 x64. I've got this error:

pecl install lua-1.1.0
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update
downloading lua-1.1.0.tgz ...
Starting to download lua-1.1.0.tgz (14,896 bytes)
.....done: 14,896 bytes
9 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
building in /var/tmp/pear-build-rootQzVV1l/lua-1.1.0
running: /var/tmp/lua/configure
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib64/php/modules
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking for lua support... yes, shared
checking for lua in default path... found in /usr
checking for lua library in default path... found in /usr/lib64
checking for a sed that does not truncate output... (cached) /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1966080
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating ./config.status
config.status: creating config.h
config.status: executing libtool commands
running: make
/bin/sh /var/tmp/pear-build-rootQzVV1l/lua-1.1.0/libtool --mode=compile cc -I. -I/var/tmp/lua -DPHP_ATOM_INC -I/var/tmp/pear-build-rootQzVV1l/lua-1.1.0/include -I/var/tmp/pear-build-rootQzVV1l/lua-1.1.0/main -I/var/tmp/lua -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/lua/lua.c -o lua.lo
libtool: compile: cc -I. -I/var/tmp/lua -DPHP_ATOM_INC -I/var/tmp/pear-build-rootQzVV1l/lua-1.1.0/include -I/var/tmp/pear-build-rootQzVV1l/lua-1.1.0/main -I/var/tmp/lua -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /var/tmp/lua/lua.c -fPIC -DPIC -o .libs/lua.o
/var/tmp/lua/lua.c: In function ‘php_lua_call_lua_function’:
/var/tmp/lua/lua.c:641: error: ‘LUA_OK’ undeclared (first use in this function)
/var/tmp/lua/lua.c:641: error: (Each undeclared identifier is reported only once
/var/tmp/lua/lua.c:641: error: for each function it appears in.)
/var/tmp/lua/lua.c: In function ‘zim_lua_eval’:
/var/tmp/lua/lua.c:689: error: ‘LUA_OK’ undeclared (first use in this function)
/var/tmp/lua/lua.c: In function ‘zim_lua_include’:
/var/tmp/lua/lua.c:739: error: ‘LUA_OK’ undeclared (first use in this function)
/var/tmp/lua/lua.c: In function ‘zm_startup_lua’:
/var/tmp/lua/lua.c:890: error: ‘LUA_OK’ undeclared (first use in this function)
/var/tmp/lua/lua.c:895: error: ‘LUA_ERRGCMM’ undeclared (first use in this function)
make: *** [lua.lo] Error 1
ERROR: `make' failed

I've these packages installed:

rpm -aq|grep lua|sort
lua-5.1.4-4.1.el6.x86_64
lua-devel-5.1.4-4.1.el6.x86_64
lua-sql-mysql-2.1.1-8.el6.x86_64
lua-static-5.1.4-4.1.el6.x86_64

We are using lua extension for the CRM. Please, suggest what's wrong, and how can I install it in CentOS. Thank you.

Test 001.phpt fails in php7 branch with Lua 5.1.5

I am running Lua 5.1.5 on Gentoo and have compiled php7 branch of php-lua against PHP7 git latest. All tests pass except 001.phpt, which fails because the expected Lua error message differs from the actual error message.

--EXPECTF--
12
-0.53657291800043
string "line":1: syntax error near 'code'

But the actual error generated by the last line is as follows:

Conversion of Lua->PHP callables when passing to a PHP callable fails

Since in https://github.com/laruence/php-lua/blob/master/lua.c#L305, a Lua object is not passed to the Lua->zval conversion function (it cannot be fetched using getThis because we're in a function called from the Lua environment), conversion of Lua callables to PHP callables when they are passed as parameters to a PHP callable fails.
I thought of a workaround: why not store all relevant data from every Lua object into lua_ce?
While I'm trying to figure out a way to implement this (kinda new to this), some feedback from the dev would be appreciated.

P.S. Nice fail with the creation of the issue eh?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.