0

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.

antonioc
  • 49
  • 7

2 Answers2

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.

Community
  • 1
  • 1
jja
  • 2,058
  • 14
  • 27
0

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

nachete70
  • 36
  • 3