简体   繁体   中英

Running dynamic shell script from php

i've been writing a simple text to speech php script that works with festvox, i've been trying to use it but it seems the part i cant get is running the text to wave converter, shell script. here is the code i've created so far,

<form action="index.php" method="get">
Say: <input type="text" name="say" />
<input type="submit" />
</form>
<?php
$myFile = "test.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $_GET["say"];
fwrite($fh, $stringData);
fclose($fh);
shell_exec('text2wave /var/www/text.txt -otype aiff -o /var/www/out.aiff');
?>

so i was wondering what possible errors i could have mad, any help?

What error messages are you getting? But if I'd to guess from that code, and that shell_exec command works from the CLI, then try using the full path to the text2wave program.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM