2
votes

Each time I try to run tests with PHPStorm I get this error:

/usr/bin/php /private/var/folders/jl/34t9y2h94jsgchv4wfcxl6g80000gn/T/ide-phpunit.php -c app --configuration /Users/simonegentili/Sviluppo/web/wishventures/SendA/app/phpunit.xml.dist WishVentures\GeeftyApiBundle\Test\Controller\ApiControllerTest /Users/simonegentili/Sviluppo/web/wishventures/SendA/src/WishVentures/GeeftyApiBundle/Tests/Controller/ApiControllerTest.php
Testing started at 18:46 ...
dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
  Referenced from: /usr/bin/php
  Reason: image not found

Process finished with exit code 133

I've found this question but

$ brew update && brew upgrade
$ brew reinstall php55

did not solve my troubles. Well, ... PHPStorm is looking for libpng15.15.dylib, but I've libpng16.16.dylib. I think is a broken link issue. How to solve it?


The reason was that I had two version of php installed on my computer. One reached via /usr/bin/php and another from /usr/local/bin/php. The first one was a link to php version 5.5.8 and the second one was 5.5.14

I sow that dyld (dynamic linker of Operating System) was looking for /usr/local/lib/libpng15.15.dylib (maybe called by php 5.5.8) but inside my /usr/local/lib/ there was not. In that folder, I got libpng16.16.dylib (I think ... because I've installed php55 via brew and this version oh php needs new version of libpng).

I undestood that my /usr/bin/php was a pointer to php 5.5.8. Instead, ... /usr/local/bin/php was 5.5.14. PHPStorm worked with /usr/bin/php that is default configuration. When I run php via console, I run /urs/local/bin/php.

Doesn't php55 install in /usr/local/bin though?Ja͢ck
Yes, ... I think the problem is in PHPStorm's phpunit.sensorario
1) What PhpStorm has to do with libpng? If that library is loaded by your PHP (or your code).. why that is a PhpStorm issue? 2) /usr/bin/php vs /usr/local/bin -- it's you who told PhpStorm to look for PHP in that folder (PHP interpreter has to be configured manually -- IDE does not do it for you automatically). So it you who needs to be blamed for the wrong path (if it's wrong, of course).LazyOne
Sure, It's me. I don't understand /private/var/folders/jl/34t9y2h94jsgchv4wfcxl6g80000gn/T/ide-phpunit.php: now I am watching it.sensorario
Thank you @LazyOne! My /usr/bin/php WAS a symbolic link to 5.5.8. /usr/local/bin/php 5.5.14. I have two version of php. o_O Now I have fixed the /urs/bin link. Now PHPStorm is working.sensorario