Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Yosemite PHP support for imagecreatefrompng

Hi,

After updating to Mac OSX 10.10 (Yosemite) and starting Apache with PHP support, everything works as before except for any image operations on PNG files. I get a "Call to undefined function imagecreatefrompng()", while any operation on JPEG files work. So GD is present, but not for PNG.

There is one line in the phpinfo() that looks like the problem: '--with-png-dir=no'

User uploaded file

User uploaded file

Any idea how to get the included PHP to work with PNGs? Thanks in advance!

MacBook Pro, OS X Mavericks (10.9)

Posted on Oct 21, 2014 1:00 PM

Reply
6 replies

Oct 22, 2014 4:54 AM in response to frosty22cz

You are right, Yosemite's PHP comes without PNG and FreeType support which makes it virtually unusable for web-workers.

A solution is to use the Homebrew package manager to painlessly build and install a complete PHP and replace it in Apache's config.

I have described the whole process in detail in this Stackoverflow answer:

http://stackoverflow.com/a/26505558/430742

Jan 28, 2015 6:48 AM in response to frosty22cz

Hello Everyone,


I found this article: http://www.fritzw.com/2014/12/10/fatal-error-call-to-undefined-function-imagecre atefrompng-php-mac-os-10-10-yosemite/


Please install follow package:

curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6

and please add follow line to your bash profile:


export PATH=/usr/local/php5/bin:$PATH

source ~/.bash_profile


Restart your server and everything, should working perfect.

Feb 3, 2015 3:29 AM in response to Mattijs

Mattijs wrote:


I am the only one that thinks it is ridiculous that in 10.10 png support was dropped from the standard php install while it was working fine in 10.9?


I think it would be appropriate to file this as a bug..

Which is the more ridiculous? Dropping PNG support or continuing to use a web platform that would do something like that?

Yosemite PHP support for imagecreatefrompng

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.