0

I am trying to execute a shell command via shell_exec (text to speech). The command works well from the shell and the paths are set correctly, but when executed from PHP it doesn't find certain libraries. This is the command

shell_exec('echo "nice voice" | text2wave -o /path/output.wav -eval "(voice_selected_voice)" 2>&1 ');

and this is the output that I get:

/usr/bin/festival: /opt/bitnami/common/lib/libstdc++.so.6: version 'GLIBCXX_3.4.11' not found (required by /usr/bin/festival)

/usr/bin/festival: /opt/bitnami/common/lib/libstdc++.so.6: version 'GLIBCXX_3.4.9' not found (required by /usr/bin/festival)

/usr/bin/festival: /opt/bitnami/common/lib/libstdc++.so.6: version 'GLIBCXX_3.4.11' not found (required by /usr/lib/libestools.so.2.1)

... and so on ...

It looks like it cannot find those libraries, but they are exactly there

Thanks

Community
  • 1
  • 1
Marc
  • 1,029
  • 1
  • 10
  • 27

1 Answers1

0

When you run these commands via shell_exec command, you are running them with the apache user permissions. You need to sudo it via root (modify the sudoers file a bit).

skrtbhtngr
  • 2,223
  • 23
  • 29