I'm trying to develop a CLI PHP application that uses the Linux command "dialog" for menu control purposes. Here is example code I am trying to run:
#!/usr/bin/php -q
<?
$cmd='dialog --backtitle "Test" --title "Main Menu" --menu "" 10 30 3 "Option 1" "" "Option 2" "" "Option 3" ""';
`$cmd`;
?>
Regardless of using backtickets, passthru, exec, or system, running this code via command line always produces the "cannot open tty-output" error.
How can I overcome this? I'd like to use dialog to build and run my menus and control everything else via PHP.
TIA.