Lua PHP: Library for extending your application with lua scripts

v1.1.0 2020-07-29 12:27 UTC

This package is auto-updated.

Last update: 2022-10-29 03:07:02 UTC


This library enables you to add Lua scripting support to your PHP applications.


The LuaSandbox class allows you to easily run user-supplied Lua scripts in an empty sandbox environment. This means that dangerous functions (i.e. for file and network IO) are unavailable by default. To make the sandbox useful, you register your own PHP-implemented functions that you allow the chunks to execute.


  • Support user-supplied scripts to respond to events in your application
  • Advanced expressions, filters, segments
  • Customizable routing
  • ... and many more :)


Check the example/ directory for a well-documented example.

About Lua


This library requires that the PHP Lua extension is installed.

A quick install guide for Ubuntu:

# Install lua library
apt-get install -y --no-install-recommends lua5.3 liblua5.3-dev
# pecl expects liblua and includes in specific locations, so move them around a bit:
cp /usr/lib/x86_64-linux-gnu/liblua5.3.a /usr/lib/liblua.a
cp /usr/lib/x86_64-linux-gnu/ /usr/lib/
ln -s /usr/include/lua5.3 /usr/include/lua
# Install the lua extension through pecl
pecl install lua
# Activate the lua extension in your PHP config
php --ini # find out where your PHP config files are located
echo "" > /path/to/my/php/conf.d/lua.ini


MIT. Please refer to the license file for details.

Brought to you by the LinkORB Engineering team

Check out our other projects at

Btw, we're hiring!