is it possible to run php page from lua programing code?

Recommended Answers

All 4 Replies

Do you mean like a shell execution?

I want to use it in freeswitch......i want only a small example in terminal..for example text.php(it contains code to print aname), text.lua page (in this page i want to code to call text.php)

plz help

Hi,

I don't know LUA, but I'm sure there are some functions that allow to execute system commands, check the documentation and the wiki of the LUA page, as test I used a library developed to simplify this task, read:

An example:

require('sh')
local cmd = tostring(php('./a.php'))
print(cmd)

Where the PHP script is:

<?php

    print 'Hello' . PHP_EOL;

Bye!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.