简体   繁体   English

从php运行动态shell脚本

[英]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. 我一直在写一个简单的文本到语音PHP脚本,与festvox一起工作,我一直在尝试使用它,但似乎我无法得到的部分是运行文件到波形转换器,shell脚本。 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. 但是,如果我想从该代码猜测,并且shell_exec命令可以从CLI运行,那么请尝试使用text2wave程序的完整路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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