簡體   English   中英

從php運行動態shell腳本

[英]Running dynamic shell script from php

我一直在寫一個簡單的文本到語音PHP腳本,與festvox一起工作,我一直在嘗試使用它,但似乎我無法得到的部分是運行文件到波形轉換器,shell腳本。 這是我到目前為止創建的代碼,

<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');
?>

所以我想知道我可能會發生什么樣的錯誤,有什么幫助嗎?

您收到了什么錯誤消息? 但是,如果我想從該代碼猜測,並且shell_exec命令可以從CLI運行,那么請嘗試使用text2wave程序的完整路徑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM