PHP Adapter scriptName, args_or_post_table [, http_method ] )

Executes a local PHP page and returns the results.



The name of the PHP file, without the extension. For example, to call a file named hello.php, you would just pass “hello”.

The php file must reside in the Coronium PHP directory.


A data table that will be used as data for POST, GET, PUT, or DELETE HTTP methods.

http_method (optional)

You can pass a specific HTTP method if needed. Defaults to “POST”



Holds the PHP result as a Lua table.


The error, if any. If there is no error it will be nil.


The error code, if any. Holds HTTP error status code.


In /php/greeting.php

  $in_data = json_decode(file_get_contents('php://input'));

  $greeting = 'Hello ' . $in_data->{"username"} . '!';

  $response = array("greeting" => $greeting);


In /lua/hello.lua

 local in_data = coronium.input()

 local answer = 'greeting', in_data )

 coronium.output( answer )