WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Php gd library ??????  (Read 11310 times)

Offline sandeep

  • Newbie
  • *
  • Posts: 19
Php gd library ??????
« on: February 07, 2011, 08:38:14 AM »
Hello i need to install gdlibrary in tinycore linux need not find the package in tiny core repository suggest me a method to do this plz help !!!!! ???

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Php gd library ??????
« Reply #1 on: February 07, 2011, 06:23:48 PM »
I'm not sure what you really need, but it might be that the 'libgd.tcz' extension is what you are after?

I don't know how that relates to php or whether you need something else or in addition to it. You better provide some more precise description of what you are trying to achieve.

Offline sandeep

  • Newbie
  • *
  • Posts: 19
Re: Php gd library ??????
« Reply #2 on: February 07, 2011, 10:27:48 PM »
Thankyou Maro for ur quick reply

In ubuntu we install gd library by

apt-get install  php5-gd and we restart apache and when we run phpinfo() it will show a separate coloum says gd library enabled. gd library is used to create images i tried libgd.tcz but that didnt worked for me

Iam attaching a link to give a clear idea of what i need

http://www.cyberciti.biz/faq/ubuntu-linux-install-or-add-php-gd-support-to-apache/

So plz help to install or create gd library for php in tiny core.. :-[

Offline maro

  • Hero Member
  • *****
  • Posts: 1228
Re: Php gd library ??????
« Reply #3 on: February 08, 2011, 12:55:58 AM »
I'm not a php5 user, so I pretty much haven't got a clue. But looking a the file list of said Ubuntu package you might need a gd library build for php5.

If your are lucky it will only be that you need a config file (in addition to the 'libgd.tcz' extension), but I somewhat doubt that this would be all. You better hope that the php5 extension maintainer (i.e. 'robc', IIRC) or some other experienced TC user can provide a better answer.

OTOH, I just spotted that the 'apache2-mod-php5.tcz' extension contains a 'gd.so' library. So it might be that you'll just need that extension (instead of the 'libgd.tcz' one).

Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: Php gd library ??????
« Reply #4 on: February 08, 2011, 04:10:27 AM »
php5 usually automatically builds in a bundled gd library (module).

Necessary steps:
1. Install apache2-mod-php5.tcz
2. Edit /usr/local/apache2/conf/php5/extensions/dist.ini to include extension=gd.so
3. Start apache with $ sudo apachectl -k start

Or use php5 extension with php as cgi module, no extension loading needed there since it's not shared but builtin. If there are special libraries needed for php extensions you can always easily grep them by running e.g. $ ldd /usr/local/lib/php/extensions/no-debug-zts-20090626/gd.so and watch out for missing libs.

[edit]
the info that libgd.tcz is needed for gd.so within dist.ini is not right as it's bundled - gonna change that in the next release.
[/edit]
« Last Edit: February 08, 2011, 04:15:25 AM by gutmensch »
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline sandeep

  • Newbie
  • *
  • Posts: 19
Re: Php gd library ??????
« Reply #5 on: February 09, 2011, 12:49:54 AM »
Hi i tried ur instructions but when i run <?php phpinfo(); ?> its not showing gd support enabled also


i am attaching a sample code that i tried running it was giving me call to undefined function imagecreatetruecolor()

I tried the code by installing gd library on ubuntu and i was able to run on it

Help me i dont know what i am missing !!!

Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: Php gd library ??????
« Reply #6 on: February 09, 2011, 10:44:14 AM »
if phpinfo is not showing:
Code: [Select]
gd
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.3.12
GIF Read Support enabled
GIF Create Support enabled
JPEG Support enabled
libJPEG Version 6b
PNG Support enabled
libPNG Version 1.2.44
WBMP Support enabled
XPM Support enabled
XBM Support enabled

Directive Local Value Master Value
gd.jpeg_ignore_warning 0 0

then gd.so is not loaded. Check the ini files in the phpinfo section, which php scans for extensions. There must be one ini file which contains a line:

extension=gd.so

and when you run

$ ldd /usr/local/lib/php/extensions/no-debug-zts-20090626/gd.so

there has to be no "not found" entry. When you changed the extension=gd.so entry then restart apache with $ apachectl -k restart. I verified that it's working on my own tc and it produces the gd output from above.

If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline sandeep

  • Newbie
  • *
  • Posts: 19
Re: Php gd library ??????
« Reply #7 on: February 09, 2011, 11:09:22 AM »
Hi
Whn i run ldd command mentioned abov iam getton a list of files with. So extension. I enabled gd.so and also i imstalled lidgd.tcz i enabled extension in dist.ini and resttarted apache jst sugst hw.   
 to troublshoot dis isssue. plz

Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: Php gd library ??????
« Reply #8 on: February 09, 2011, 11:24:29 AM »
post your /usr/local/apache2/conf/php5/extensions/dist.ini

post the output of $ cat /usr/local/apache2/logs/error_log

If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: Php gd library ??????
« Reply #9 on: February 09, 2011, 01:48:27 PM »
gd is supported in php5. The bundled gd was used. The problem is that the bundled gd does not support jpeg.

Using this:
Code: [Select]
~$ echo '<?php var_dump(gd_info()); ?>' | php-cgi
Gives this:
Quote
X-Powered-By: PHP/5.3.3
Content-type: text/html

array(11) {
  ["GD Version"]=>
  string(27) "bundled (2.0.34 compatible)"
  ["FreeType Support"]=>
  bool(false)
  ["T1Lib Support"]=>
  bool(false)
  ["GIF Read Support"]=>
  bool(true)
  ["GIF Create Support"]=>
  bool(true)
  ["JPEG Support"]=>
  bool(false)
  ["PNG Support"]=>
  bool(true)
  ["WBMP Support"]=>
  bool(true)
  ["XPM Support"]=>
  bool(false)
  ["XBM Support"]=>
  bool(true)
  ["JIS-mapped Japanese Font Support"]=>
  bool(false)
}
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: Php gd library ??????
« Reply #10 on: February 09, 2011, 02:01:45 PM »
hm, I don't know why php-cgi doesn't support jpeg in gd, mod_php5.so with gd does support it, I cited exactly the part of phpinfo I getting from a tinycore + apache2 + apache2-mod-php5 running and extension=gd.so enabled.

@robc: do you use --with-jpeg-dir=/usr configure option for php like I do?
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)

Offline robc

  • Sr. Member
  • ****
  • Posts: 447
Re: Php gd library ??????
« Reply #11 on: February 09, 2011, 02:20:15 PM »
do you use --with-jpeg-dir=/usr configure option for php like I do?
No. I didn't notice a problem with php finding libjpeg during the build so I didn't include that switch. There are no failed tests in php5.test (in the source repo) that are related to gd or jpeg.
"Never give up! Never surrender!" - Commander Peter Quincy Taggart

"Make it so." - Captain Picard

Offline sandeep

  • Newbie
  • *
  • Posts: 19
Re: Php gd library ??????
« Reply #12 on: February 10, 2011, 01:29:23 AM »
@gutmensch

my apache errorlog

[Thu Feb 10 06:21:23 2011] [notice] caught SIGTERM, shutting down
[Thu Feb 10 06:21:31 2011] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Thu Feb 10 06:21:31 2011] [notice] Digest: generating secret for digest authentication ...
[Thu Feb 10 06:21:31 2011] [notice] Digest: done
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-zts-20090626/gd.so' - /usr/local/lib/php/extensions/no-debug-zts-20090626/gd.so: undefined symbol: libiconv_open in Unknown on line 0
[Thu Feb 10 06:21:32 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8p DAV/2 PHP/5.3.5 configured -- resuming normal operations

i had found libiconv_open in unknown

So i installed libiconv.tcz and also i enabled the extension (extension=iconv.so) in dist.ini i am attaching my dist.ini file

; Extension INI File for apache2-mod-php5
; tinycore linux specific,
; (c) Robert Schumann 2010
;
; Enabled extensions don't need special dependencies, although
; for example you need mysql.tcz for mysql, mysqli or pdo-mysql
;
; Extensions enabled by default
extension=apc.so
extension=uploadprogress.so
extension=memcache.so
extension=suhosin.so
extension=calendar.so
extension=bcmath.so
extension=exif.so
extension=ftp.so
extension=gettext.so
extension=openssl.so
extension=mbstring.so
extension=pdo.so
extension=pdo_mysql.so
extension=sqlite.so
extension=mysql.so
extension=mysqli.so
extension=zip.so
extension=zlib.so
extension=soap.so
extension=sockets.so
extension=sysvmsg.so
extension=sysvsem.so
extension=sysvshm.so
extension=wddx.so
extension=shmop.so

; Extensions disabled by default
; requires ImageMagick.tcz
;extension=imagick.so
; requires bzip2-lib.tcz
;extension=bz2.so
; requires curl.tcz
extension=curl.so
; requires bsddb.tcz and libgdbm.tcz
;extension=dba.so
; requires enchant.tcz
;extension=enchant.so
; requires libgd.tcz
extension=gd.so
; requires gmp.tcz
;extension=gmp.so
; requires libiconv.tcz
extension=iconv.so
; requires icu.tcz
;extension=intl.so
; requires openldap.tcz
;extension=ldap.so
; requires libmcrypt.tcz
;extension=mcrypt.so
; requires postgresql-lib.tcz
;extension=pgsql.so
;extension=pdo.so
;extension=pdo_pgsql.so
;extension=pdo_mysql.so
; requires sqlite3.tcz
;extension=sqlite3.so
;extension=pdo_sqlite.so
; requires readline.tcz
;extension=readline.so
; requires recode.tcz
;extension=recode.so
; requires net-snmp.tcz
;extension=snmp.so
; requires libxslt.tcz
;extension=xsl.so
; requires unixODBC
;extension=odbc.so

 :-[


Offline sandeep

  • Newbie
  • *
  • Posts: 19
Re: Php gd library ??????
« Reply #13 on: February 10, 2011, 01:52:56 AM »
@robc i am getting the same output that u got.... :) the problem is that gd.so module is nt getting loaded by my apache errorlog is showing me the msg....

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-zts-20090626/gd.so' - /usr/local/lib/php/extensions/no-debug-zts-20090626/gd.so: undefined symbol: libiconv_open in Unknown on line 0
[Thu Feb 10 06:21:32 2011] [notice] Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8p DAV/2 PHP/5.3.5 configured -- resuming normal operations

So i installed libiconv.tcz and also i enabled the extension (extension=iconv.so) in dist.ini i am attaching my dist.ini file

plz help

Offline gutmensch

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 605
  • I can make it disappear, have no fear!
    • remembrance blog
Re: Php gd library ??????
« Reply #14 on: February 10, 2011, 03:39:03 AM »
if you installed both php5 and apache2-mod-php5 then it's logical you get the same output as robc when running php-cgi, but it's useless this way. you have to use EITHER one OR the other. gd.so has nothing to do with php5.tcz extension. for running php web server you need only:

php5 + any web server capable of cgi handling and use cgi method to connect to php

OR

apache2-mod-php5 + apache2

do NOT mix them!!

what is the output or error_log when you install libiconv.tcz and restart?
If I seem unduly clear to you, you must have misunderstood what I said. (Alan Greenspan)