问题
I have a PHP script that calls exec() to execute PRAAT, 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:
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 permissions).
Looking apache log this is the error: terminate called after throwing an instance of 'MelderError' Aborted
How I can solve this problem? :S
Thanks a lot.
回答1:
Update
This was finally fixed in version 5.4.15. The problem was that Praat attempted to write to its preferences directory, which is located under the user's home
. This would of course run into problems when the user was www-data
or the like, who don't normally have a home directory.
From the changelog:
5.4.15 (1 August 2015)
- Introduced several command line options that make it easier to call Praat from a web server.
The options are documented in the manual, under the heading "Calling Praat from a web server". The relevant option is --no-pref-files
.
Original answer
This exact same problem came up on the mailing list some time ago: MelderError when running as Apache.
The sender of that email reported this problem existing in version 5.3.16, but not in 5.2.17. This was recognised as a possible bug, but the changelog of the following versions do not seem to address this specifically.
What version are you using? See if this is fixed in a more recent version.
回答2:
I had the same problem and the solution is using praat 5.1.25. You can download from this url: http://pkgs.org/ubuntu-10.04/ubuntu-universe-amd64/praat_5.1.25-1_amd64.deb.html
来源:https://stackoverflow.com/questions/14295793/error-executing-praat-from-php-terminate-called-after-throwing-an-instance-of