EXEC a COBOL application in PHP

IDENTIFICATION DIVISION.
PROGRAM-ID. HELLO-WORLD.
	AUTHOR. Michael Coughlan.
*> https://askubuntu.com/questions/287180/how-to-compile-and-run-a-cobol-program
PROCEDURE DIVISION.
	DISPLAY 'Hello world!'.
	DISPLAY 'https://askubuntu.com/questions/287180/how-to-compile-and-run-a-cobol-program'.
	DISPLAY 'How to compile and run a cobol program'.
	DISPLAY 'cobc -free -x -o helloworld helloworld.cbl'.
	DISPLAY './helloworld'.
	DISPLAY 'https://www.tutorialspoint.com/cobol/'.
STOP RUN.

Compile NOT executed with exec()

(You must do it in the terminal. Either local or remote with SSH)

exec('cobc -free -x -o helloworld helloworld.cbl', $output1, $retval1);

SSH in Telnet app on iPadOutput

SSH in Telnet app on iPadOutput

Returned with status 1 and output:
Array
(
)

Compiled helloworld output in array

exec('files/helloworld', $output2, $retval2);

Returned with status 0 and output:
Array
(
    [0] => Hello world!
    [1] => https://askubuntu.com/questions/287180/how-to-compile-and-run-a-cobol-program
    [2] => How to compile and run a cobol program
    [3] => cobc -free -x -o helloworld helloworld.cbl
    [4] => ./helloworld
    [5] => https://www.tutorialspoint.com/cobol/
)

Compiled helloworld output in string

str_replace("\n", '<br />', shell_exec('./helloworld') )

Hello world!
https://askubuntu.com/questions/287180/how-to-compile-and-run-a-cobol-program
How to compile and run a cobol program
cobc -free -x -o helloworld helloworld.cbl
./helloworld
https://www.tutorialspoint.com/cobol/