4

I am trying to enable GD in my installation of Apache2, PHP5 and MySQL on my Ubuntu server.

I installed php5-gd with:
apt-get install php5-gd

And when I run php -i I get:

gd

GD Support => enabled
GD Version => 2.0
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.4.8
T1Lib Support => enabled
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => unknown
PNG Support => enabled
libPNG Version => 1.2.46
WBMP Support => enabled

Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 0 => 0

But it does not show up in phpinfo();
I have restarted the server four times and I have tried to restart Apache2 four million times.

Does anyone have any idea of how to fix this problem?

Qzen
  • 43
  • 1
  • 4

3 Answers3

2

It looks like libjpeg62 isn't installed on your server.

Install libjpeg62and restart Apache2.

sudo apt-get install libjpeg62

Airikr
  • 136
  • 3
0

Are you sure that the php being pointed in your apache webserver is the same as the php you are running in your program?

From what I can see, php -i, is actually running phpinfo();.

If you are in doubt:

   echo '<?php phpinfo(); ?>' | php 
mdpc
  • 11,698
  • 28
  • 51
  • 65
  • http://www.pastebay.net/1150906?p=serverfault&submit=unlock – Qzen Oct 18 '12 at 22:00
  • But when I do in a php-file and run it in the browser it doesn't show. – Qzen Oct 18 '12 at 22:01
  • In `/etc/apache2/mods-enabled/php5.load` it sais `LoadModule php5_module /usr/lib/apache2/modules/libphp5.so`. But when i do `which php5` it sais `/usr/bin/php5`. Does that have anything to do with this? – Qzen Oct 18 '12 at 22:13
  • What about 'which php'? – mdpc Oct 18 '12 at 22:15
  • `which php` shows `/usr/bin/php` – Qzen Oct 18 '12 at 22:16
  • After a little bit of tinkering with Apache2/PHP logs I managed to get a error in my log file. `PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/extensions/gd.so' - libjpeg.so.62: cannot open shared object file: No such file or directory in Unknown on line 0` – Qzen Oct 18 '12 at 23:53
0

had the same issue in Windows / Apache. Fixed by using the full path in extension_dir

change: extension_dir = "ext"

to: extension_dir = "c:/progra~1/php5513/ext"

obviously change your path to suit your install folder

Jenny D
  • 27,358
  • 21
  • 74
  • 110
Ian
  • 1