Jan 9, 2015

解决 phpbrew gd 的 undefined symbol: php_gd_gdImageJpegCtx in Unknown on line 0

Issues coming one after one, started from the day I upgrade my machine from ubuntu 12.04 to 14.04.

Thanks to our ancient symfony 1.4 project, I had to ask phpbrew for php version 5.3.x, and then I got a problem with gd when project rebuild on the step of regenerating avatars.

It said in bloody color:

The image processing library GD is not enabled. See PHP Manual for installation instructions.

WTF?

I checked the extensions of current php:

  $phpbrew ext

Oh well, gd ext not enabled, so

  $phpbrew ext enable gd

However, it complained:
 
PHP Warning:  PHP Startup: Unable to load dynamic library '/home/htsg/.phpbrew/php/php-5.3.29/lib/php/extensions/no-debug-non-zts-20090626/gd.so' - /home/htsg/.phpbrew/php/php-5.3.29/lib/php/extensions/no-debug-non-zts-20090626/gd.so: undefined symbol: php_gd_gdImageJpegCtx in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library '/home/htsg/.phpbrew/php/php-5.3.29/lib/php/extensions/no-debug-non-zts-20090626/gd.so' - /home/htsg/.phpbrew/php/php-5.3.29/lib/php/extensions/no-debug-non-zts-20090626/gd.so: undefined symbol: php_gd_gdImageJpegCtx in Unknown on line 0
===> Enabling extension gd
gd extension is not installed. Suggestions:
$ phpbrew ext install gd

Damn it, how could it suggest to install an extension already installed, sth wrong with it definitely....

Googling time....... with painful tries...ruined my whole lovely friday morning....

When it turned to be hopeless, found a working solution:

$cd
$cd .phpbrew/build/php-5.3.29/ext/gd/
$make clean
$phpbrew ext install gd -- --with-libdir=lib/i386-linux-gnu --with-gd=shared --enable-gd-native-ttf --with-jpeg-dir=/usr --with-png-dir=/usr

This time it said install ok as before, but I saw gd in the enabled list when check extensions.

Thanks to this link for saving the rest of my Friday!






5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Saved my day! Thx.

    ReplyDelete
  3. I am continually amazed by the amount of information available on this subject.What you presented was well researched and well worded in order to get your stand on this across to all your readers. undefined

    ReplyDelete
  4. IECS is a consulting company specializing in studying abroad in Germany, especially studying German nursing in Hanoi and Ho Chi Minh City. IECS is the most prestigious and best German vocational training center in Vietnam. See more at vuatiengduc for more details

    ReplyDelete
  5. IECS is a consulting company specializing in studying abroad in Germany, especially studying German nursing in Hanoi and Ho Chi Minh City. IECS is the most prestigious and best German vocational training center in Vietnam. See more at luatphapduc to know more

    ReplyDelete