1

I am using a library that used ImagePng() to generate png files. However I got Fatal error: Call to undefined function ImagePng(). I have enabled GD extension according to phpinfo.

I can run the script with CLI, but cannot with a webserver(apache).

Is ImagePng the same one as imagepng?

The two phps are different, the one run in CLI is 5.5.23, and the one run in web server is 5.5.20 (built in with Yosemite).

I just found that php function names are NOT case sensitive! WTF!

Can you tell me what extension should I enable to use imagepng? I have already enabled GD2.

update

imagepng and ImagePng are the same because php's function/class names are case-insensitive.

The problem here is that the built in PHP's GD extension of MacOS X doesn't support PNG and FreeType. Problem solved according to here.

Community
  • 1
  • 1
leetom
  • 723
  • 1
  • 6
  • 27
  • nope imagepng() is diff from ImagePng() . check this link http://php.net/manual/en/function.imagepng.php – Satya Jul 01 '15 at 05:56
  • @Satya They are the same, http://stackoverflow.com/questions/5643496/are-php-functions-case-sensitive/5643544#5643544 – leetom Jul 01 '15 at 06:04

0 Answers0