1 2 Previous Next 25 Replies Latest reply on Jul 22, 2010 11:18 PM by 801146

    Anyone knows How to get gd library to work with this PHP?

    807567
      I am using sun one web server 7 with php add-on. and I am trying to use gd library to work with php. Anyone knows how to ?
        • 1. Re: Anyone knows How to get gd library to work with this PHP?
          801146
          First check to see if GD is compiled into this PHP. Create a simple PHP file with phpinfo(); as the only instruction, then scan through the list of extensions. If it's available then there will be a section called "GD" with the parameters available.

          If GD isn't already compiled into this PHP binary then you'll need to recompile PHP with the GD extension. This is easier than it sounds if you have an environment that already capable of building (see php.net for instructions on how to assemble a buildable environment).

          Once you have a rebuilt PHP it should be trivial to make Web Server use the new binary. Your Web Server is already configured to use PHP, you just need to replace the PHP binary Web Server is looking for. Just make sure you compile PHP to use the same API (NSAPI or FastCGI) that Web Server is expecting.
          • 2. Re: Anyone knows How to get gd library to work with this PHP?
            807567
            j.mccabe,

            Thanks for your reply. right now I am using the php that was compiled by sun for use with sun web server 7. how do I recompile it with gd library? I am trying to look for instruction at php.net, but was unable to find it. Do you have the link? Thanks.
            • 3. Re: Anyone knows How to get gd library to work with this PHP?
              807567
              This is the version of php I am using.

              phppack-5_2_0-solaris-amd64.zip
              • 4. Re: Anyone knows How to get gd library to work with this PHP?
                801146
                I'm afraid I don't know if that build of PHP has GD in it or not. I'll assume that it does not since you're having problems.

                If you're on Solaris you can use the PHP from the Web Stack by following Sriram's instructions: [http://blogs.sun.com/natarajan/entry/a_simple_way_to_get|http://blogs.sun.com/natarajan/entry/a_simple_way_to_get]

                If you need to compile from scratch then you can follow these instructions: [http://developers.sun.com/webtier/reference/techart/php2.html|http://developers.sun.com/webtier/reference/techart/php2.html]

                Since you're using the add-on Sun provided, the installer script configured Web Server to use the PHP binary. During installation you will have selected either NSAPI or FastCGI, so you will need to build the new binary to use the same API your Web Server is already configured to use.

                The first essential step in compiling PHP (after assembling the necessary tools and dependencies) will be your configure line. For reference, here's the line I use:
                ./configure --with-openssl --with-gettext --with-zlib --with-jpeg-dir=/opt --with-gd --with-mysql=/opt --with-png-dir=/opt --with-mcrypt --enable-mbstring --enable-sockets 
                After that the process is more-or-less laid out in the link above.
                • 5. Re: Anyone knows How to get gd library to work with this PHP?
                  807567
                  I've downloaded gd library from sunfreeware and all its dependencies and installed them. With the downloaded php-5.3.2 source code from php.net, I run the command

                  ./configure with-openssl with-gettext with-zlib with-jpeg-dir=/usr/local/lib with-gd with-mysql=/usr/local/lib with-png-dir=/usr/local/lib with-mcrypt enable-mbstring enable-sockets

                  I got the following error.

                  loading cache ./config.cache
                  checking for Cygwin environment... no
                  checking for mingw32 environment... no
                  checking for egrep... egrep
                  checking for a sed that does not truncate output... /usr/bin/sed
                  checking host system type... i386-pc-solaris2.10
                  checking target system type... i386-pc-solaris2.10
                  checking for gcc... no
                  checking for cc... no
                  configure: error: no acceptable cc found in $PATH
                  • 6. Re: Anyone knows How to get gd library to work with this PHP?
                    801146
                    Ahh. Windows.

                    Compiling for Windows is a pain. It's the only platform that PHP.net distributes in binary form just 'cause it's such a pain.

                    http://windows.php.net/download/

                    Unfortunately I couldn't really tell you which of those to download.
                    • 7. Re: Anyone knows How to get gd library to work with this PHP?
                      807567
                      I am running on solaris 10 x86 machine. This is the version I downloaded.

                      PHP 5.3.2

                      Complete Source Code

                      PHP 5.3.2 (tar.gz) [13,413Kb] - 04 Mar 2010 from

                      http://www.php.net/downloads.php#v5
                      • 8. Re: Anyone knows How to get gd library to work with this PHP?
                        801146
                        Ahh. OK. A bad assumption on my part based on the Cygwin failure in your quoted text combined with late-night laziness. Sorry about that.

                        Your failure shows that your build environment is missing a lot of necessary components. Let's start with these:

                        checking for Cygwin environment... no
                        checking for mingw32 environment... no
                        checking for gcc... no
                        checking for cc... no

                        Have you confirmed that you installed the dependencies that PHP requires as described here ?
                        • 9. Re: Anyone knows How to get gd library to work with this PHP?
                          807567
                          I have downloaded and installed following dependencies for php

                          gcc (recommended, other C compilers may work)
                          make
                          flex
                          bison
                          m4
                          autoconf
                          automake
                          perl
                          gzip
                          tar
                          GNU sed

                          as well as following dependencies for gd library

                          xpm,
                          freetype,
                          fontconfig,
                          libiconv,
                          libintl,
                          libpng,
                          zlib,
                          expat,
                          jpeg
                          and /usr/local/lib/libgcc_s.so.1 from libgcc-3.4.6 or gcc-3.4.6 or higher.

                          but I am still getting the same error.

                          Does the files or the dependencies packages needs to be in a specific folder? or the php has to be in a specific folder? or Do I need to point them to the right directory? currently the dependence packages are located under /usr/local/
                          • 10. Re: Anyone knows How to get gd library to work with this PHP?
                            801146
                            The configure script is going to look in the default OS locations for the various dependencies. If you haven't installed them with the OS-native package manager then the odds are pretty good that the configure script won't be able to find them.

                            A quick Googling found me this blog: [http://blogs.whardy.com/john/2008/01/02/moodle-on-solaris/|http://blogs.whardy.com/john/2008/01/02/moodle-on-solaris/] It seems to be more-or-less a step-by-step for compiling PHP on Solaris and then using it with Web Server. Can you double-check your steps against it?
                            • 11. Re: Anyone knows How to get gd library to work with this PHP?
                              807567
                              with the following command

                              # ./configure with-gettext with-jpeg-dir=/usr/local/bin with-gd with-png-dir=/usr/local/bin enable-mbstring enable-sockets

                              I got the following output.

                              loading cache ./config.cache
                              checking for Cygwin environment... (cached) no
                              checking for mingw32 environment... (cached) no
                              checking for egrep... (cached) egrep
                              checking for a sed that does not truncate output... (cached) /usr/bin/sed
                              checking host system type... i386-pc-solaris2.10
                              checking target system type... i386-pc-solaris2.10
                              checking for gcc... (cached) gcc
                              checking whether the C compiler (gcc ) works... yes
                              checking whether the C compiler (gcc ) is a cross-compiler... no
                              checking whether we are using GNU C... (cached) yes
                              checking whether gcc accepts -g... (cached) yes
                              checking how to run the C preprocessor... (cached) gcc -E
                              checking for icc... no
                              checking for suncc... no
                              checking whether gcc and cc understand -c and -o together... (cached) yes
                              checking how to run the C preprocessor... gcc -E
                              checking for AIX... no
                              checking whether ln -s works... (cached) yes
                              checking for system library directory... lib
                              checking whether to enable runpaths... yes
                              checking if compiler supports -R... (cached) yes
                              checking for gawk... (cached) nawk
                              checking if nawk is broken... ./configure: !: not found
                              no
                              checking for bison... (cached) bison -y
                              checking for bison version... (cached) invalid
                              configure: warning: bison versions supported for regeneration of the Zend/PHP parsers: 1.28 1.35 1.75 1.875 2.0 2.1 2.2 2.3 2.4 2.4.1 (found: none).
                              checking for re2c... no
                              configure: warning: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
                              ./configure: !: not found
                              ./configure: !: not found
                              checking whether to enable computed goto gcc extension with re2c... no
                              checking whether to force non-PIC code in shared modules... no
                              checking whether /dev/urandom exists... yes
                              checking for pthreads_cflags... (cached)
                              checking for pthreads_lib... (cached)

                              Configuring SAPI modules
                              checking for AOLserver support... no
                              checking for Apache 1.x module support via DSO through APXS... no
                              checking for Apache 1.x module support... no
                              checking whether to enable Apache charset compatibility option... no
                              checking for Apache 2.0 filter-module support via DSO through APXS... no
                              checking for Apache 2.0 handler-module support via DSO through APXS... no
                              checking for Apache 1.x (hooks) module support via DSO through APXS... no
                              checking for Apache 1.x (hooks) module support... no
                              checking whether to enable Apache charset compatibility option... no
                              checking for Caudium support... no
                              checking for CLI build... yes
                              checking for Continuity support... no
                              checking for embedded SAPI library support... no
                              checking for Zeus ISAPI support... no
                              checking for LiteSpeed support... no
                              checking for Milter support... no
                              checking for NSAPI support... no
                              checking for PHTTPD support... no
                              checking for Pi3Web support... no
                              checking whether Roxen module is build using ZTS... no
                              checking for Roxen/Pike support...
                              checking for thttpd... no
                              checking for TUX... no
                              checking for webjames... no
                              checking whether to build CGI binary... yes
                              checking for socklen_t in sys/socket.h... yes
                              checking for sun_len in sys/un.h... no
                              checking whether cross-process locking is required by accept()... yes
                              checking for chosen SAPI module... cgi
                              • 12. Re: Anyone knows How to get gd library to work with this PHP?
                                807567
                                Running system checks
                                checking for sendmail... (cached) /usr/sbin/sendmail
                                checking whether system uses EBCDIC... (cached) no
                                checking whether byte ordering is bigendian... (cached) no
                                checking whether writing to stdout works... (cached) yes
                                checking for socket... no
                                checking for __socket... no
                                checking for socket in -lsocket... yes
                                checking for socketpair... yes
                                checking for htonl... yes
                                checking for gethostname... yes
                                checking for gethostbyaddr... no
                                checking for __gethostbyaddr... no
                                checking for gethostbyaddr in -lnsl... yes
                                checking for yp_get_default_domain... yes
                                checking for dlopen... yes
                                checking for sin in -lm... (cached) yes
                                checking for inet_aton... yes
                                checking for ANSI C header files... (cached) yes
                                checking for dirent.h that defines DIR... (cached) yes
                                checking for opendir in -ldir... (cached) no
                                checking for inttypes.h... (cached) yes
                                checking for stdint.h... (cached) yes
                                checking for dirent.h... (cached) yes
                                checking for ApplicationServices/ApplicationServices.h... (cached) no
                                checking for sys/param.h... (cached) yes
                                checking for sys/types.h... (cached) yes
                                checking for sys/time.h... (cached) yes
                                checking for netinet/in.h... (cached) yes
                                checking for alloca.h... (cached) yes
                                checking for arpa/inet.h... (cached) yes
                                checking for arpa/nameser.h... (cached) yes
                                checking for assert.h... (cached) yes
                                checking for crypt.h... (cached) yes
                                checking for dns.h... (cached) no
                                checking for fcntl.h... (cached) yes
                                checking for grp.h... (cached) yes
                                checking for ieeefp.h... (cached) yes
                                checking for langinfo.h... (cached) yes
                                checking for limits.h... (cached) yes
                                checking for locale.h... (cached) yes
                                checking for monetary.h... (cached) yes
                                checking for netdb.h... (cached) yes
                                checking for pwd.h... (cached) yes
                                checking for resolv.h... (cached) yes
                                checking for signal.h... (cached) yes
                                checking for stdarg.h... (cached) yes
                                checking for stdlib.h... (cached) yes
                                checking for string.h... (cached) yes
                                checking for syslog.h... (cached) yes
                                checking for sysexits.h... (cached) yes
                                checking for sys/ioctl.h... (cached) yes
                                checking for sys/file.h... (cached) yes
                                checking for sys/mman.h... (cached) yes
                                checking for sys/mount.h... (cached) yes
                                checking for sys/poll.h... (cached) yes
                                checking for sys/resource.h... (cached) yes
                                checking for sys/select.h... (cached) yes
                                checking for sys/socket.h... (cached) yes
                                checking for sys/stat.h... (cached) yes
                                checking for sys/statfs.h... (cached) yes
                                checking for sys/statvfs.h... (cached) yes
                                checking for sys/vfs.h... (cached) yes
                                checking for sys/sysexits.h... (cached) no
                                checking for sys/varargs.h... (cached) yes
                                checking for sys/wait.h... (cached) yes
                                checking for sys/loadavg.h... (cached) yes
                                checking for termios.h... (cached) yes
                                checking for unistd.h... (cached) yes
                                checking for unix.h... (cached) no
                                checking for utime.h... (cached) yes
                                checking for sys/utsname.h... (cached) yes
                                checking for sys/ipc.h... (cached) yes
                                checking for dlfcn.h... (cached) yes
                                checking for assert.h... (cached) yes
                                checking for fopencookie... (cached) no
                                checking for broken getcwd... yes
                                checking for broken libc stdio... (cached) yes
                                checking whether struct tm is in sys/time.h or time.h... (cached) time.h
                                checking for tm_zone in struct tm... (cached) no
                                checking for tzname... (cached) yes
                                checking for missing declarations of reentrant functions... done
                                checking for fclose declaration... ok
                                checking for tm_gmtoff in struct tm... (cached) no
                                checking for struct flock... (cached) yes
                                checking for socklen_t... (cached) yes
                                checking size of size_t... (cached) 4
                                • 13. Re: Anyone knows How to get gd library to work with this PHP?
                                  807567
                                  checking size of long long... (cached) 8
                                  checking size of long long int... (cached) 8
                                  checking size of long... (cached) 4
                                  checking size of int... (cached) 4
                                  checking size of intmax_t... (cached) 8
                                  checking size of ssize_t... (cached) 4
                                  checking size of ptrdiff_t... (cached) 4
                                  checking for st_blksize in struct stat... (cached) yes
                                  checking for st_blocks in struct stat... (cached) yes
                                  checking for st_rdev in struct stat... (cached) yes
                                  checking for size_t... (cached) yes
                                  checking for uid_t in sys/types.h... (cached) yes
                                  checking for struct sockaddr_storage... (cached) yes
                                  checking for field sa_len in struct sockaddr... (cached) no
                                  checking for IPv6 support... (cached) yes
                                  checking for vprintf... (cached) yes
                                  checking for alphasort... (cached) yes
                                  checking for asctime_r... (cached) yes
                                  checking for chroot... (cached) yes
                                  checking for ctime_r... (cached) yes
                                  checking for cuserid... (cached) yes
                                  checking for crypt... (cached) yes
                                  checking for flock... (cached) no
                                  checking for ftok... (cached) yes
                                  checking for funopen... (cached) no
                                  checking for gai_strerror... (cached) yes
                                  checking for gcvt... (cached) yes
                                  checking for getloadavg... (cached) yes
                                  checking for getlogin... (cached) yes
                                  checking for getprotobyname... (cached) yes
                                  checking for getprotobynumber... (cached) yes
                                  checking for getservbyname... (cached) yes
                                  checking for getservbyport... (cached) yes
                                  checking for gethostname... (cached) yes
                                  checking for getrusage... (cached) yes
                                  checking for gettimeofday... (cached) yes
                                  checking for gmtime_r... (cached) yes
                                  checking for getpwnam_r... (cached) yes
                                  checking for getgrnam_r... (cached) yes
                                  checking for getpwuid_r... (cached) yes
                                  checking for grantpt... (cached) yes
                                  checking for inet_ntoa... (cached) yes
                                  checking for inet_ntop... (cached) yes
                                  checking for inet_pton... (cached) yes
                                  checking for isascii... (cached) yes
                                  checking for link... (cached) yes
                                  checking for localtime_r... (cached) yes
                                  checking for lockf... (cached) yes
                                  checking for lchown... (cached) yes
                                  checking for lrand48... (cached) yes
                                  checking for memcpy... (cached) yes
                                  checking for memmove... (cached) yes
                                  checking for mkstemp... (cached) yes
                                  checking for mmap... (cached) yes
                                  checking for nl_langinfo... (cached) yes
                                  checking for perror... (cached) yes
                                  checking for poll... (cached) yes
                                  checking for ptsname... (cached) yes
                                  checking for putenv... (cached) yes
                                  checking for realpath... (cached) yes
                                  checking for random... (cached) yes
                                  checking for rand_r... (cached) yes
                                  checking for scandir... (cached) yes
                                  checking for setitimer... (cached) yes
                                  checking for setlocale... (cached) yes
                                  checking for localeconv... (cached) yes
                                  checking for setenv... (cached) yes
                                  checking for setpgid... (cached) yes
                                  checking for setsockopt... (cached) yes
                                  checking for setvbuf... (cached) yes
                                  checking for shutdown... (cached) yes
                                  checking for sin... (cached) yes
                                  checking for snprintf... (cached) yes
                                  checking for srand48... (cached) yes
                                  checking for srandom... (cached) yes
                                  checking for statfs... (cached) yes
                                  checking for statvfs... (cached) yes
                                  checking for std_syslog... (cached) no
                                  checking for strcasecmp... (cached) yes
                                  checking for strcoll... (cached) yes
                                  checking for strdup... (cached) yes
                                  checking for strerror... (cached) yes
                                  checking for strftime... (cached) yes
                                  checking for strnlen... (cached) no
                                  checking for strptime... (cached) yes
                                  checking for strstr... (cached) yes
                                  checking for strtok_r... (cached) yes
                                  checking for symlink... (cached) yes
                                  checking for tempnam... (cached) yes
                                  checking for tzset... (cached) yes
                                  checking for unlockpt... (cached) yes
                                  checking for unsetenv... (cached) yes
                                  checking for usleep... (cached) yes
                                  checking for utime... (cached) yes
                                  checking for vsnprintf... (cached) yes
                                  checking for vasprintf... (cached) no
                                  checking for asprintf... (cached) no
                                  checking for nanosleep... (cached) yes
                                  checking for getaddrinfo... (cached) yes
                                  checking for strlcat... (cached) yes
                                  checking for strlcpy... (cached) yes
                                  checking for getopt... (cached) yes
                                  checking whether utime accepts a null argument... (cached) yes
                                  checking for working alloca.h... (cached) yes
                                  checking for alloca... (cached) yes
                                  checking for declared timezone... (cached) yes
                                  checking for type of reentrant time-related functions... (cached) POSIX
                                  checking for readdir_r... (cached) yes
                                  checking for type of readdir_r... (cached) POSIX
                                  checking for in_addr_t... (cached) yes
                                  checking for crypt_r... (cached) no
                                  • 14. Re: Anyone knows How to get gd library to work with this PHP?
                                    807567
                                    General settings
                                    checking whether to include gcov symbols... no
                                    checking whether to include debugging symbols... no
                                    checking layout of installed files... PHP
                                    checking path to configuration file... DEFAULT
                                    checking where to scan for configuration files...
                                    checking whether to enable safe mode by default... no
                                    checking for safe mode exec dir... /usr/local/php/bin
                                    checking whether to enable PHP's own SIGCHLD handler... no
                                    checking whether to enable magic quotes by default... no
                                    checking whether to explicitly link against libgcc... yes
                                    checking whether to enable short tags by default... yes
                                    checking whether to enable dmalloc... no
                                    checking whether to enable IPv6 support... yes
                                    checking how big to make fd sets... using system default

                                    Configuring extensions
                                    checking size of long... (cached) 4
                                    checking size of int... (cached) 4
                                    checking for int32_t... (cached) yes
                                    checking for uint32_t... (cached) yes
                                    checking for sys/types.h... (cached) yes
                                    checking for inttypes.h... (cached) yes
                                    checking for stdint.h... (cached) yes
                                    checking for string.h... (cached) yes
                                    checking for stdlib.h... (cached) yes
                                    checking for strtoll... (cached) yes
                                    checking for atoll... (cached) yes
                                    checking for strftime... (cached) yes
                                    checking which regex library to use... php
                                    checking whether to enable LIBXML support... yes
                                    checking libxml2 install dir... no
                                    checking for xml2-config path... (cached) /usr/bin/xml2-config
                                    checking whether libxml build works... (cached) yes
                                    checking for OpenSSL support... no
                                    checking for Kerberos support... no
                                    checking for PCRE library to use... bundled
                                    checking whether to enable the SQLite3 extension... yes
                                    checking bundled sqlite3 library... yes
                                    checking for ZLIB support... no
                                    checking if the location of ZLIB install directory is defined... no
                                    checking whether to enable bc style precision math functions... no
                                    checking for BZip2 support... no
                                    checking whether to enable calendar conversion support... no
                                    checking whether to enable ctype functions... yes
                                    checking for cURL support... no
                                    checking if we should use cURL for url streams... no
                                    checking for QDBM support... no
                                    checking for GDBM support... no
                                    checking for NDBM support... no
                                    checking for Berkeley DB4 support... no
                                    checking for Berkeley DB3 support... no
                                    checking for Berkeley DB2 support... no
                                    checking for DB1 support... no
                                    checking for DBM support... no
                                    checking for CDB support... no
                                    checking for INI File support... no
                                    checking for FlatFile support... no
                                    checking whether to enable DBA interface... no
                                    1 2 Previous Next