1

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

$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???

Any suggestions why it will work fine through terminal but not shell_exec php?

user1503606
  • 3,872
  • 13
  • 44
  • 78

1 Answers1

0

I think problem is in LD_LIBRARY_PATH and/or with library paths in general.

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.

rkosegi
  • 14,165
  • 5
  • 50
  • 83
  • hi thanks for the reply if i type echo $LD_LIBRARY_PATH into terminal i get a empty output, if i type ldd /usr/bin/wav2png into terminal i get -bash: ldd: command not found? – user1503606 Sep 12 '12 at 16:47
  • @user1503606 : Please share os info (uname -a ; cat /etc/*release*) – rkosegi Sep 12 '12 at 16:49
  • Darwin Mac-mini.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64 – user1503606 Sep 12 '12 at 16:51
  • aaah, I'm afraid I can not help you directly (i'm just Linux/Solaris guy), you need to check your OS docs who to troubleshoot library linking problems.Maybe this can help you : http://www.noah.org/wiki/List_shared_libraries or this : http://www.noktec.be/archives/1104 .Please let me know what you get. – rkosegi Sep 12 '12 at 16:54
  • no problems thanks for looking contacted the developer see if he can shed some light – user1503606 Sep 12 '12 at 16:56
  • this actually worked for me http://stackoverflow.com/questions/10107671/ffmpeg-mamp-dyld-library-not-loaded-error ;) – user1503606 Sep 12 '12 at 17:25
  • great! good to know that you fix it.BTW : Next time please attach info with OS/Environment, it will decrease time of fix, it really helps :) – rkosegi Sep 12 '12 at 18:46