Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running lampp 1.7.1 on lubuntu oneiric.
I need to add extension for php_gd.

I installed php5-gd by

sudo apt-get install php5-gd

Had a look at php.ini and noticed the line


Searched for something with php_gd and found


Tried to copy it to

sudo cp -av '/usr/include/php5/ext/gd/php_gd.h' '/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/php_gd.h'
sudo chmod 755 '/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/php_gd.h'

Added to php.ini


Restarted lampp and got this error:

PHP Warning:  PHP Startup: Unable to load dynamic library
'/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/php_gd.h' -
invalid ELF header in Unknown on line 0
share|improve this question
up vote 1 down vote accepted

Why you are trying to install xampp/lampp if you already have everything on your Ubuntu repository ?

Anyway to answer to your problem, you are trying to load a header file as a module. :) It will not work.

For your lampp probably you should copy /usr/lib/php5/20090626/ to /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/, but I don't know if the lampp php is compatible with Ubuntu php. Just try it.

For configuration just use:

and it should work.

share|improve this answer
Because we have different projects developed and running on differente environments .. that means project A developed under Apache 2.2.11 with MySQL 5.1.33 and PHP 5.2.9 while project B developed under Apache 2.2.21 with MySQL 5.5.16 and PHP 5.3.8 and so on .. I'm a developer so when they ask me to modify something I need to recreate quickly the correct environment for the project to modify. If they ask me to modify project A I will install lampp 1.7.1 for example while I need to install lampp 1.7.7 to modify project B and so on. How could I install old versions using the repository otherwise? – Luca Borrione Jan 24 '12 at 13:27
Anyway, thank you for your tip! I havent' noticed I was searching somethig starting with php like php_gd :( shame on me for trying to use a header as a module (I'm still a beginner in linux and not a tech .. so I'm confused sometimes). I will try anyway but I think I won't be able to use it because they are build for different versions see… another post of mine when I faced the same problem for memcache – Luca Borrione Jan 24 '12 at 13:38
I cannot use something compiled with module API=20090626 in php compiled with module API=20060613 Best would be to have old modules of or compiled with module API=20060613 I guess .. but how? – Luca Borrione Jan 24 '12 at 13:38
Tried and got this error: PHP Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/ undefined symbol: gdImageGifCtx in Unknown on line 0 – Luca Borrione Jan 24 '12 at 13:41
yes. that means your lampp php is nopt compatible with gd from ubuntu. give me the output of /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/. Run this command: ls -l /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/*gd* and post here the result – Sacx Jan 24 '12 at 15:38

You can try it by installing the lamp development package instead of php-gd

Use the link to check out for downloading the lamp development package.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.