1

I coded a PHP application that creates charts using gnuplot for specific client applications. It has run well for years.

I’ve just installed gnuplot on new iMac running Mavericks. I used MacPorts to do the install. The install went smoothly. I can access and run gnuplot successfully from the command line in the terminal.

However, when I attempt to run gnuplot via my PHP application, I get the following error:

dyld: Library not loaded: /opt/local/lib/libpng16.16.dylib   Referenced from: /opt/local/bin/gnuplot   Reason: Incompatible library version: gnuplot requires version 26.0.0 or later, but libpng16.16.dylib provides version 19.0.0

There are two things about this that are puzzling me at the moment:

  • Why would gnuplot give no error when called from the command line, but would give this error in response to a PHP call?

  • Macports installed libpng @1.6.9_1. According to the libpng home page (http://www.libpng.org/pub/png/libpng.html), 1.6.9 is the latest version. Why would I get an error saying I need to update libpng?

Does anyone have any thoughts on how I might fix this?

Thanks very much in advance to all for any info!

VikR
  • 4,818
  • 8
  • 51
  • 96
  • Maybe some environmental differences are upsetting it. This [happened to me](http://stackoverflow.com/questions/9967217/inkscape-inside-php-apache-doesnt-render-fonts-to-png) and it turned out it was the lack of home path that did it. – halfer Feb 28 '14 at 22:15
  • Where does the libpng live that Macports installed? Knowing that might help resolve whether it is a path issue. – andyras Mar 01 '14 at 12:19
  • What doed the comamnd "otool -L /opt/local/bin/gnuplot" gives? (both from command line and PHP) – bibi Mar 01 '14 at 13:39
  • Here's the output of "otool -L /opt/local/bin/gnuplot" from the command line: /opt/local/lib/libpng16.16.dylib (compatibility version 26.0.0, current version 26.0.0) Here's the output of "otool -L /opt/local/bin/gnuplot" from PHP: /opt/local/lib/libpng16.16.dylib (compatibility version 26.0.0, current version 26.0.0) – VikR Mar 02 '14 at 04:42
  • I have another version of this PHP app. It is in a different folder. Oddly, it accesses gnuPlot perfectly! Both versions of this PHP app have worked perfectly for years. – VikR Mar 02 '14 at 04:43

0 Answers0