简体   繁体   English

shell_exec命令找不到库

[英]shell_exec command cannot find libraries

I am trying to execute a shell command via shell_exec (text to speech). 我试图通过shell_exec(文本到语音)执行shell命令。 The command works well from the shell and the paths are set correctly, but when executed from PHP it doesn't find certain libraries. 该命令在外壳程序中运行良好,并且路径设置正确,但是从PHP执行时找不到特定的库。 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:找不到版本'GLIBCXX_3.4.11'(/ 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:找不到版本'GLIBCXX_3.4.9'(/ 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) / usr / bin / festival:/opt/bitnami/common/lib/libstdc++.so.6:找不到版本'GLIBCXX_3.4.11'(/usr/lib/libestools.so.2.1要求)

... and so on ... ... 等等 ...

It looks like it cannot find those libraries, but they are exactly there 似乎找不到这些库,但它们确实在那里

Thanks 谢谢

When you run these commands via shell_exec command, you are running them with the apache user permissions. 通过shell_exec命令运行这些命令时,将使用apache用户权限运行它们。 You need to sudo it via root (modify the sudoers file a bit). 您需要通过root对其进行sudo (稍微修改sudoers文件)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM