Need help to install php gd on ubuntu with lampp (xampp)

6,103

Solution 1

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/gd.so 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:

extension=gd.so

and it should work.

Solution 2

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:
6,103

Related videos on Youtube

Luca Borrione
Author by

Luca Borrione

Updated on September 18, 2022

Comments

  • Luca Borrione
    Luca Borrione almost 2 years

    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

    ;extension=php_gd.dll
    

    Searched for something with php_gd and found

    /usr/include/php5/ext/gd/php_gd.h
    

    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

    extension=php_gd.h
    

    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' -
    /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/php_gd.h:
    invalid ELF header in Unknown on line 0
    
  • Luca Borrione
    Luca Borrione over 12 years
    Anyway, thank you for your tip! I havent' noticed gd.so 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 serverfault.com/questions/352771/… another post of mine when I faced the same problem for memcache
  • Luca Borrione
    Luca Borrione over 12 years
    Tried and got this error: PHP Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/gd.‌​so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/gd.s‌​o: undefined symbol: gdImageGifCtx in Unknown on line 0
  • Marcela Lozano
    Marcela Lozano over 12 years
    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
  • Luca Borrione
    Luca Borrione over 12 years
    The result is:-rwxr-xr-x 1 root root 103800 2011-12-13 20:00 /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/gd.s‌​o .. anyway in the meanwhile I ran a phpinfo and noticed that gd comes already enabled with any version of lampp .. :) .. is there a way I can test everything is working right with it? Anyway the issue with memcache still remains
  • Luca Borrione
    Luca Borrione over 12 years
    Maybe it's better to close this question, because it's related to gd .. how could it be done?
  • Marcela Lozano
    Marcela Lozano over 12 years
    That probably means is builtin. delete the extension ( rm /opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/gd.s‌​o ). Get this file from here dagondesign.com/files/gd-test.txt, rename it as php (gd-test.php) and see if is working on your server. What problem do you have with memcache ?
  • Luca Borrione
    Luca Borrione over 12 years
    Everything done. Your test gives everything supported but T1Lib, XPM and JIS-mapped Japanese Font .. thank you! With memcache I've the same problem I thought to have with gd: how to install old php estensions with old versions of lampp .. please see this other question of mine presenting this problem .. maybe it's better if you answer me there, if you have any answer serverfault.com/questions/352771/…
  • Marcela Lozano
    Marcela Lozano over 12 years
    I'm glad is working. I will take a look on that question asap.