[英]command works fine through terminal but not shell_exec php
Got a weird issue i have installed wav2png on my mac osx with lion now and works fine when using terminal no problem but when i try to run it using shell_exec with php like below 出现一个奇怪的问题,我现在已经在狮子的mac osx上安装了wav2png,并且在使用终端时可以正常工作,但是当我尝试使用shell_exec和php来运行它时,如下所示
$wav2png = shell_exec("cd {$targetDir} && /usr/bin/wav2png --foreground-color=000000ff --background-color=00000000 -o example2.png f86150f88d.wav 2>&1");
echo "<pre>" . $wav2png . "</pre>";
I get the output 我得到了输出
dyld: Library not loaded: /opt/local/lib/libpng15.15.dylib
Referenced from: /usr/bin/wav2png
Reason: Incompatible library version: wav2png requires version 28.0.0 or later, but libpng15.15.dylib provides version 23.0.0
Cant find a way to update libpng??? 无法找到更新libpng的方法???
Any suggestions why it will work fine through terminal but not shell_exec php? 有什么建议为什么它可以通过终端正常运行,但不能通过shell_exec php正常运行?
I think problem is in LD_LIBRARY_PATH and/or with library paths in general. 我认为问题出在LD_LIBRARY_PATH和/或库路径中。
Go to shell and type 转到外壳并输入
echo $LD_LIBRARY_PATH
and 和
ldd /usr/bin/wav2png
Do exact same from php script (be sure to grab output from these commands) and compare, I'm pretty sure you find the answer. 从php脚本执行完全相同的操作(请确保从这些命令中获取输出)并进行比较,我很确定您找到了答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.