Error compiling PHP with GD support

Você pode ler este post em português também.

Hi Folks!

If you try to compile PHP with the –with-gd in a system that has 1.4 or higher version of libpng, you will have a compilation error.

The solution until the PHP developers does not release the next stable version with the fix is very simple, but requires that you change one line in the source code of PHP.

Short way:

  • Open the file ext/gd/libgd/gd_png.c, go to the line 148 and you will find this:
    if (!png_check_sig (sig, 8)) { /* bad signature */
  • Comment it (better) or remove it (worse), replacing with this:
    if (png_sig_cmp (sig, 0, 8)) { /* bad signature */

If you want to know all the details, visit this page at PHP website.

One thought on “Error compiling PHP with GD support

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s