• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

How-to install / enable GD2 support

A

alejandro

Guest
Hi,

I would like to know how to add GD2 support to my server using Plesk psa v8.1.1_build81070423.15, operating on a Linux Fedora Core 4 2.6.16.27-061216a and PHP Version 5.0.4

Here are some informations about my server :

Configure Command :
'./configure' '--build=x86_64-redhat-linux' '--host=x86_64-redhat-linux' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-expat-dir=/usr' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-kerberos' '--enable-ucd-snmp-hack' '--with-unixODBC=shared,/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio' '--with-mime-magic=/etc/httpd/conf/magic' '--without-sqlite' '--with-libxml-dir=/usr' '--with-xml' '--with-apxs2=/usr/sbin/apxs' '--without-mysql' '--without-gd' '--without-odbc' '--disable-dom' '--disable-dba'

I noticed the '--without-gd', that clearly disable GD2 in my server.

additional .ini files parsed :
/etc/php.d/bcmath.ini, /etc/php.d/dba.ini, /etc/php.d/dom.ini, /etc/php.d/gd.ini, /etc/php.d/imap.ini, /etc/php.d/ioncube-loader.ini, /etc/php.d/mbstring.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/ncurses.ini, /etc/php.d/soap.ini, /etc/php.d/xmlrpc.ini, /etc/php.d/xsl.ini

I tried to have a look about how-to do that but I found nothing matching my need. I heard about the fact that I would have to uninstall PHP and rebuild it with GD but I don't know at all how to do that. Moreover, when I var_dump the gd_info() function, here is what I get :

array(12) {
["GD Version"]=>
string(27) "bundled (2.0.28 compatible)"
["FreeType Support"]=>
bool(true)
["FreeType Linkage"]=>
string(13) "with freetype"
["T1Lib Support"]=>
bool(false)
["GIF Read Support"]=>
bool(true)
["GIF Create Support"]=>
bool(true)
["JPG Support"]=>
bool(true)
["PNG Support"]=>
bool(true)
["WBMP Support"]=>
bool(true)
["XPM Support"]=>
bool(false)
["XBM Support"]=>
bool(true)
["JIS-mapped Japanese Font Support"]=>
bool(false)
}

Please can someone tell me how to upgrade my server without crashing Plesk or anything else ? Because I don't know that much about Linux, I would need a step by step tutorial. Thank you by advance for your help.
 
Hi, I logged into my server using PuTTY, then I logged in as root

[root@s15256513 ~]# yum install php-gd
Repository extras is listed more than once in the configuration
Repository updates-released is listed more than once in the configuration
Repository base is listed more than once in the configuration
Setting up Install Process
Setting up repositories
base 100% |=========================| 1.1 kB 00:00
updates-released 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@s15256513 ~]#

Then I tried to use the resize-image functionnality of my web application without any success. It doesn't seems to work. Can someone help me please ? Why is it written "Nothing to do" ? What shall I do ? Thanks by advance for your help.

PS: When I do phpinfo(), I still can see the '--without-gd' information inside the configure commands (see my first post).
 
php-gd might already be installed, and you've got a config file problem:

rpm -q php-gd

phpinfo() won't give you full results on modern PHP implementations if you just look at what was done through autoconf, you need to scroll down and look at what modules are loaded.
 
Hi,

Thanks for your help AtomicTurtle.

Here is the list of the loaded modules that appears in the apache2handler section of the phpinfo()

Loaded Modules :

core prefork http_core mod_so mod_access mod_auth mod_auth_anon mod_auth_dbm mod_auth_digest util_ldap mod_auth_ldap mod_include mod_log_config mod_logio mod_env mod_cern_meta mod_expires mod_deflate mod_headers mod_usertrack mod_setenvif mod_mime mod_dav mod_status mod_autoindex mod_asis mod_info mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_proxy proxy_ftp proxy_http proxy_connect mod_cache mod_suexec mod_disk_cache mod_file_cache mod_mem_cache mod_cgi mod_fpcgid mod_perl mod_php5 mod_python mod_ssl

I can't find any module called GD. Here is what appears when I type "rpm -q php-gd".

[root@s15256513 ~]# rpm -q php-gd
php-gd-5.0.4-10.5
[root@s15256513 ~]#

Now if the GD module is not loaded, is it complicated to load it :confused: What should I do ?

Thanks for your help.
 
Up !

I'm still trying to sort out this problem of GD library. Here's what I found so far (thanks to AtomicTurtle for his help so far) :

I first started to type :

[root@s15256513 ~]# rpm -qil php-gd
Name : php-gd Relocations: (not relocatable)
Version : 5.0.4 Vendor: Red Hat, Inc.
Release : 10.5 Build Date: Tue 08 Nov 2005 02:29:29 PM CET
Install Date: Mon 24 Jul 2006 04:27:03 PM CEST Build Host: hs20-bc1-5.build.redhat.com
Group : Development/Languages Source RPM: php-5.0.4-10.5.src.rpm
Size : 329085 License: The PHP License
Signature : DSA/SHA1, Tue 08 Nov 2005 05:59:16 PM CET, Key ID b44269d04f2a6fd2
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
URL : http://www.php.net/
Summary : A module for PHP applications for using the gd graphics library
Description :
The php-gd package contains a dynamic shared object that will add
support for using the gd graphics library to PHP.
/etc/php.d/gd.ini
/usr/lib64/php/modules/gd.so
[root@s15256513 ~]#

Apparently, GD is installed and the .so module is located within /usr/lib64/php/modules/

The I type

[root@s15256513 ~]#rpm -q gd
gd-2.0.33-2
[root@s15256513 ~]#

So what I understand is that the GD version is 2.0.33

Now something very important is what I found on the Internet :

Apache with PHP can be installed a few different ways. One way is to statically embed the PHP binary into the Apache binary. This is probably the fastest and best way to run PHP. You can also install PHP as a DSO module

So apparently, if DSO is supported on my server, I shouldn't have to recompile my applications. To check this I type :

[root@s15256513 ~]#httpd -l
core.c
prefork.c
http_core.c
mod_so.c
[root@s15256513 ~]#

The mod_so beeing enabled, I should be able to add existing modules directly from within httpd.conf. I check in this file but do not find any "LoadModule" related to "gd.so".

I try to add a line to load it with :

LoadModule php-gd_module /usr/lib64/php/modules/gd.so

I update the httpd.conf file and then restart Apache2 :

[root@s15256513 ~]#apachectl -k restart
Syntax error on line 191 of etc/httpd/conf/httpd.conf:
Cannot load /usr/lib64/php/modules/gd.so into server: /usr/lib64/php/modules/gd.so: undefined symbol: empty_string
[root@s15256513 ~]#

and I'm stucked here.
Can someone help me please ?
 
I have a similar problem - I also have GD installed

$rpm -q php-gd
php-gd-5.2.3-1.el4.art

$locate gd.so
/usr/lib/libgd.so.2
/usr/lib/libgd.so.2.0.0
/usr/lib/php/modules/gd.so

I add the module and I get an error

Cannot load /usr/lib/php/modules/gd.so into server: /usr/lib/php/modules/gd.so: undefined symbol: php_stream_stdio_ops
 
REvisa que el entorno chroot del host tenga instalado gcc, yo tengoe se mismo problema
revisando en internet mucha documentacion sobre esta libreria, he encontrado que esta esta escrita en c, y el entorno chroot del sitio que la necesita no lo trae, aunque esta libreria GD este instalada para todo el servidor no esta habilitada para /home/virtual/siteXX.

Aun me encuentra realizando pruebas hacerca de esta libreria :)
 
Hi,

get the src rpm, or any spec file, make a rpm rebuild after correcting that --wihout--gd in the spec file and you are good to go.

Anyway I don't understand the request.. every graphic sript basically needs the convert and similar graphic transformation binaries which are part of the gd and not php-gd so it can be avoided ther is Image Magick also if gd won't reslve. There are options and options ...
 
Back
Top