-1

I have a PHP script that calls exec() to execute a c++ program but when I call it from the browser it doesn't work. Instead if I use command-line "php5 ./mypage.php" it works.

This is my PHP page:

<?php exec("./praat ./FeaturesExtraction.praat ./emotion.wav ./output/"); ?>

Praat is a program to analyse speech. This program take as input a script FeaturesExtraction.praat and a wav emotion.wav and write the output in the directory "output" (that has all the permission).

I've tested two Web Servers, Apache and Lighttpd, but I've no results.

Someone can help me? How can I solve this problem? Or how can I wrap praat to use it from web?

Thanks.

4

2 回答 2

0

the problem could be "./praat". Try using the full path to the executable or do the php equivalent of chdir() to the appropriate directory

于 2013-01-11T19:37:31.583 回答
0

经过不同的测试,这是我的结论:我解决了权限问题,所以我的简单 C 二进制文件可以工作,但不幸的是没有。我看到了 apache 日志文件,错误是:在抛出“MelderError”实例后调用终止已中止

因此,我将提出另一个适当的问题: Error execution praat from PHP: terminate called after throwing an instance of 'MelderError' Aborted

谢谢大家。

于 2013-01-12T17:17:28.203 回答