dongxian1921
2011-11-02 04:01
浏览 56
已采纳

从php运行动态shell脚本

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?

图片转代码服务由CSDN问答提供 功能建议

我一直在编写一个简单的文本到语音php脚本,与festvox一起使用,我一直在尝试使用 但它似乎我无法获得的部分是运行文件到波形转换器,shell脚本。 这是我到目前为止创建的代码,

 &lt; form action =“index.php”method =“get”&gt; 
Say:&lt; input type =  “text”name =“say”/&gt; 
&lt; input type =“submit”/&gt; 
&lt; / form&gt; 
&lt;?php 
 $ myFile =“test.txt”; 
 $ fh =  fopen($ myFile,'w')或死(“无法打开文件”); 
 $ stringData = $ _GET [“say”]; 
fwrite($ fh,$ stringData); 
 nclclose($ fh)  ; 
shell_exec('text2wave /var/www/text.txt -otype aiff -o /var/www/out.aiff'); 
?&gt; 
   
 
 < 那么我想知道我可能会发生什么样的错误,有什么帮助吗? 
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

1条回答 默认 最新

  • dopuz8728 2011-11-02 04:06
    最佳回答

    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.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题