I am running PHP 5.5 on Mac OS X Yosemite. PHP 5.5 is installed with Homebrew.
I have a .php script that has to be executed asynchronously (from CLI). If I execute it from terminal, it works fine. However, if I execute it within my PHP application it does not work.
Code that launches the script (run by Apache) is:
// 1.- Alter path so that Homebrew PHP is launched
putenv("PATH=/usr/local/bin:" . getenv("PATH"));
// 2.- Exec PHP script in background
exec("php /path/to/my/file/script.php > /dev/null &");
I get the following error:
Library not loaded: /usr/local/lib/libpng16.16.dylib
Referenced from: /usr/local/bin/php
Reason: no suitable image found. Did find:
/usr/local/lib/libpng16.16.dylib: stat() failed with errno=13
/usr/local/lib/libpng16.16.dylib: stat() failed with errno=13
Any clues?
I already tried solution in dyld: Library not loaded: /usr/local/lib/libpng16.16.dylib with anything php related with no luck