geting user input from php and using perl for execution

I am using festival speech synthesis system and I would like to allow user input in a browser. This will be taken by a php page which is then supposed to pass the input text to a perl script. The perl script should pass this text to the festival engine by executing a unix command. this in turn generates an audio file to be played on the browser. How do I call perl from php and take control back to php after executing the unix command? Or is there another way of doing it?

Why don't your php script call festival directly, rather than using a perl script as an intermediary?

Hi all,
I decided to call festival directly from the php script as shown below but it is not generating the wav file as it is supposed to.

$text2wave_cmd = sprintf("/home/susan/Desktop/new/festival/bin/text2wave audio/hello -o audio/hello.wav");
exec($text2wave_cmd);

However, when I execute the same command in the terminal as shown below it works

susan@susan-laptop:/var/www$ /home/susan/Desktop/new/festival/bin/text2wave audio/hello -o audio/hello.wav

Please help me.