Link to home
Start Free TrialLog in
Avatar of Daniel Wilson
Daniel WilsonFlag for United States of America

asked on

How do I add GD to my LAMP server? (dummy-level answer please!)

I have a dedicated virtual LAMP server.

PHP Version 5.2.4-2ubuntu5.9

It lacks the GD library.  I do have root access, but I'm not sure I want to recompile PHP.

http://www.php.net/manual/en/image.installation.php is confusing me ... makes me think I need to recompile.  Is that true?  I just REALLY don't want to hose my entire PHP installation.

Thanks!
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Please read the man page here:
http://us2.php.net/manual/en/image.setup.php
SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Daniel Wilson

ASKER

Thanks, Ray.

It says:
GD NOT INSTALLED

Which I'd suspected since phpinfo() didn't say anything about it.

So ... for my step-by-step, I would:
1. Download both the PNG and JPG libraries linked from the requirements page
2. "configure PHP --with-gd[=DIR]"

where do I type that phrase?  In a config file somewhere?  surely not just in my PuTTY session?

As you've suspected, Linux configuration is not my cup of tea ... so thanks for your patient help!
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks, Marmata75.  that appeared to work ... but ... Ray's GD detection script still says GD NOT INSTALLED and my graphs still don't work.  And phpinfo still does not list GD.

Did I do something wrong?

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  defoma fontconfig-config libfontconfig1 libfreetype6 libgd2-xpm libjpeg62
  libpng12-0 libt1-5 libxpm4 ttf-dejavu ttf-dejavu-core ttf-dejavu-extra
Suggested packages:
  defoma-doc dfontmgr psfontmgr x-ttcidfont-conf libfreetype6-dev libgd-tools
Recommended packages:
  libft-perl
The following NEW packages will be installed:
  defoma fontconfig-config libfontconfig1 libfreetype6 libgd2-xpm libjpeg62
  libpng12-0 libt1-5 libxpm4 php5-gd ttf-dejavu ttf-dejavu-core
  ttf-dejavu-extra
0 upgraded, 13 newly installed, 0 to remove and 1 not upgraded.
Need to get 5761kB of archives.
After this operation, 12.1MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://us.archive.ubuntu.com hardy/main defoma 0.11.10-0.2 [101kB]
Get:2 http://us.archive.ubuntu.com hardy/main ttf-dejavu-core 2.23-1 [1347kB]
Get:3 http://us.archive.ubuntu.com hardy/main ttf-dejavu-extra 2.23-1 [2885kB]
Get:4 http://us.archive.ubuntu.com hardy/main ttf-dejavu 2.23-1 [3102B]
Get:5 http://us.archive.ubuntu.com hardy/main fontconfig-config 2.5.0-2ubuntu3 [182kB]
Get:6 http://us.archive.ubuntu.com hardy-updates/main libfreetype6 2.3.5-1ubuntu4.8.04.2 [347kB]
Get:7 http://us.archive.ubuntu.com hardy/main libfontconfig1 2.5.0-2ubuntu3 [89.4kB]
Get:8 http://us.archive.ubuntu.com hardy/main libjpeg62 6b-14 [86.5kB]
Get:9 http://us.archive.ubuntu.com hardy-updates/main libpng12-0 1.2.15~beta5-3ubuntu0.1 [189kB]
Get:10 http://us.archive.ubuntu.com hardy/main libxpm4 1:3.5.7-1 [41.4kB]
Get:11 http://us.archive.ubuntu.com hardy-updates/main libgd2-xpm 2.0.35.dfsg-3ubuntu2.1 [321kB]
Get:12 http://us.archive.ubuntu.com hardy/main libt1-5 5.1.1-5 [137kB]
Get:13 http://us.archive.ubuntu.com hardy-updates/main php5-gd 5.2.4-2ubuntu5.9 [32.9kB]
Fetched 5761kB in 18s (316kB/s)
Preconfiguring packages ...
Selecting previously deselected package defoma.
(Reading database ... 50490 files and directories currently installed.)
Unpacking defoma (from .../defoma_0.11.10-0.2_all.deb) ...
Selecting previously deselected package ttf-dejavu-core.
Unpacking ttf-dejavu-core (from .../ttf-dejavu-core_2.23-1_all.deb) ...
Selecting previously deselected package ttf-dejavu-extra.
Unpacking ttf-dejavu-extra (from .../ttf-dejavu-extra_2.23-1_all.deb) ...
Selecting previously deselected package ttf-dejavu.
Unpacking ttf-dejavu (from .../ttf-dejavu_2.23-1_all.deb) ...
Selecting previously deselected package fontconfig-config.
Unpacking fontconfig-config (from .../fontconfig-config_2.5.0-2ubuntu3_all.deb) ...
Selecting previously deselected package libfreetype6.
Unpacking libfreetype6 (from .../libfreetype6_2.3.5-1ubuntu4.8.04.2_i386.deb) ...
Selecting previously deselected package libfontconfig1.
Unpacking libfontconfig1 (from .../libfontconfig1_2.5.0-2ubuntu3_i386.deb) ...
Selecting previously deselected package libjpeg62.
Unpacking libjpeg62 (from .../libjpeg62_6b-14_i386.deb) ...
Selecting previously deselected package libpng12-0.
Unpacking libpng12-0 (from .../libpng12-0_1.2.15~beta5-3ubuntu0.1_i386.deb) ...
Selecting previously deselected package libxpm4.
Unpacking libxpm4 (from .../libxpm4_1%3a3.5.7-1_i386.deb) ...
Selecting previously deselected package libgd2-xpm.
Unpacking libgd2-xpm (from .../libgd2-xpm_2.0.35.dfsg-3ubuntu2.1_i386.deb) ...
Selecting previously deselected package libt1-5.
Unpacking libt1-5 (from .../libt1-5_5.1.1-5_i386.deb) ...
Selecting previously deselected package php5-gd.
Unpacking php5-gd (from .../php5-gd_5.2.4-2ubuntu5.9_i386.deb) ...
Setting up defoma (0.11.10-0.2) ...

Setting up ttf-dejavu-core (2.23-1) ...

Setting up ttf-dejavu-extra (2.23-1) ...

Setting up ttf-dejavu (2.23-1) ...
Setting up fontconfig-config (2.5.0-2ubuntu3) ...

Setting up libfreetype6 (2.3.5-1ubuntu4.8.04.2) ...

Setting up libfontconfig1 (2.5.0-2ubuntu3) ...

Setting up libjpeg62 (6b-14) ...

Setting up libpng12-0 (1.2.15~beta5-3ubuntu0.1) ...

Setting up libxpm4 (1:3.5.7-1) ...

Setting up libgd2-xpm (2.0.35.dfsg-3ubuntu2.1) ...

Setting up libt1-5 (5.1.1-5) ...

Setting up php5-gd (5.2.4-2ubuntu5.9) ...

Processing triggers for libc6 ...
ldconfig deferred processing now taking place

Open in new window

Hi Daniel,

sorry forgot to say you should restart apache to have the new extension properly recognized. Can you just type "sudo apache2ctl restart" at the command prompt, and verify if it's working now?

Thanks,
]\/[arco
I restarted but got errors ... apache is running again, but still w/o GD


dwilson@williamston:/etc/init.d$ /etc/init.d/apache2  restart
 * Restarting web server apache2                                                [Mon Jan 04 07:36:58 2010] [warn] NameVirtualHost *:443 has no VirtualHosts
httpd (pid 18002?) not running
[Mon Jan 04 07:37:08 2010] [warn] NameVirtualHost *:443 has no VirtualHosts
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Awesome.  Thanks!