Error on compiling php for GD on SOLARIS 10


 
Thread Tools Search this Thread
Operating Systems Solaris Error on compiling php for GD on SOLARIS 10
# 1  
Old 08-21-2006
Error on compiling php for GD on SOLARIS 10

Hi everyone,

I have SUn E250 server running solaris 10. I have installed apache 2 + MySQL + PHP-5.1.4 following the guidelines on this website
http://meljr.com/~meljr/AMPSolaris10.html

Excellent document for first time installation. Now, because I wanted to use Coppermine Photo Gallery, I realised I required GD or ImageMagick.

So I decided to go for GD2. I didn't realise that PHP already had GD2 installed as a extension. So I checked my installed director /usr/local/include/php/ext .... no GD and checked phpinfo.php no GD listed.

An since I had no idea how to use that extension file from /php-5.1.4/ext/gd folder, I decided to download GD and build it from source. As requirement of GD, i installed libraries for png, jpeg, zlib and many more and all were installed into /usr/local/lib (thats what I think as I saw all the lib files there).

Anyways then to combine gd with php, I decided to recompile php with the following options..... plz note I executed the ./configure command under the
/php-5.1.4 directory.
Code:
./configure --with-apxs2=/usr/apache2/bin/apxs \
>             --with-gd \
>             --with-zlib-dir="/usr" \
>             --with-png-dir="/usr/local" \
>             --with-jpeg-dir="/usr/local" \
 >            --enable-gd-native-ttf --with-freetype-dir=/usr \
 >            --with-mysql=/usr/sfw --enable-dbase \
 >            --with-libxml-dir=/usr/local \
>             --with-config-file-path=/etc/apache2

<snip>
creating libtool
appending configuration tag "CXX" to libtool

Generating files
creating ./config.status
creating php5.spec
creating main/build-defs.h
creating scripts/phpize
creating scripts/man1/phpize.1
creating scripts/php-config
creating scripts/man1/php-config.1
creating sapi/cli/php.1
creating main/php_config.h
main/php_config.h is unchanged
creating main/internal_functions.c
creating main/internal_functions_cli.c
+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE.  By continuing this installation |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

#

Then I did "gmake / make" gives me the same result
Code:
# gmake
/bin/sh /php-5.1.4/libtool --silent --preserve-dup-deps --mode=compile gcc  -Iext/standard/ -I/php-5.1.4/ext/standard/ -DPHP_ATOM_INC -I/php-5.1.4/include -I/php-5.1.4/main -I/php-5.1.4 -I/usr/local/include/libxml2 -I/php-5.1.4/ext/date/lib -I/usr/local/include -I/usr/local/include/freetype2 -I/usr/sfw/include/mysql -I/php-5.1.4/TSRM -I/php-5.1.4/Zend  -D_POSIX_PTHREAD_SEMANTICS  -I/usr/local/include -g -O2   -c /php-5.1.4/ext/standard/info.c -o ext/standard/info.lo 
<snip>
Zend/zend_objects.lo Zend/zend_object_handlers.lo Zend/zend_objects_API.lo Zend/zend_mm.lo Zend/zend_default_classes.lo Zend/zend_execute.lo sapi/cli/php_cli.lo sapi/cli/php_cli_readline.lo sapi/cli/getopt.lo main/internal_functions_cli.lo -lmysqlclient -lfreetype -lpng -lz -ljpeg -lz -lresolv -lm -lnsl -lsocket -lgcc -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl  -o sapi/cli/php

Undefined                       first referenced
 symbol                             in file
libiconv_close                      ext/gd/libgd/.libs/gdkanji.o
libiconv_open                       ext/gd/libgd/.libs/gdkanji.o
libiconv                            ext/gd/libgd/.libs/gdkanji.o
ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
gmake: *** [sapi/cli/php] Error 1
#
#

How do I get GD to work with my already compiled PHP ? Can someone please help me ? I have spent 2 complete days searching google and a lot of forums, but I've had just no luck.

I don't have any compulsion to use GD2 only, if someone knows how to get ImageMagick working, please do let me know, because I have tried to build it too using the install instructions for UNIX on their website, but got the following errors after I executed make (./configure for image magick was successful too)
snapshot of error from image magick installation
Code:
depbase=`echo Magick++/lib/Thread.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; \
if /bin/bash ./libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H  -I. -I. -I./magick -I./wand  -I. -I.  -I./Magick++/lib -I./Magick++/lib -I/usr/sfw/include/freetype2 -I/usr/sfw/include -I/usr/openwin/include -I/usr/openwin/include/X11 -I/usr/local/include/libxml2   -D_REENTRANT -pthread -MT Magick++/lib/Thread.lo -MD -MP -MF "$depbase.Tpo" -c -o Magick++/lib/Thread.lo Magick++/lib/Thread.cpp; \
then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
g++: unrecognized option `-pthread'
depbase=`echo Magick++/lib/TypeMetric.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`; \
if /bin/bash ./libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H  -I. -I. -I./magick -I./wand  -I. -I.  -I./Magick++/lib -I./Magick++/lib -I/usr/sfw/include/freetype2 -I/usr/sfw/include -I/usr/openwin/include -I/usr/openwin/include/X11 -I/usr/local/include/libxml2   -D_REENTRANT -pthread -MT Magick++/lib/TypeMetric.lo -MD -MP -MF "$depbase.Tpo" -c -o Magick++/lib/TypeMetric.lo Magick++/lib/TypeMetric.cpp; \
then mv -f "$depbase.Tpo" "$depbase.Plo"; else rm -f "$depbase.Tpo"; exit 1; fi
g++: unrecognized option `-pthread'
/bin/bash ./libtool --silent --tag=CXX --mode=link g++   -D_REENTRANT -pthread  -L/usr/openwin/lib -R/usr/openwin/lib -L/usr/sfw/lib -R/usr/sfw/lib -lfreetype -L/usr/local/lib -o Magick++/lib/libMagick++.la -rpath /usr/local/lib -version-info 10:4:0 Magick++/lib/Blob.lo  Magick++/lib/BlobRef.lo  Magick++/lib/CoderInfo.lo  Magick++/lib/Color.lo  Magick++/lib/Drawable.lo  Magick++/lib/Exception.lo  Magick++/lib/Functions.lo  Magick++/lib/Geometry.lo  Magick++/lib/Image.lo  Magick++/lib/ImageRef.lo  Magick++/lib/Montage.lo  Magick++/lib/Options.lo  Magick++/lib/Pixels.lo  Magick++/lib/STL.lo  Magick++/lib/Thread.lo  Magick++/lib/TypeMetric.lo magick/libMagick.la wand/libWand.la 
libtool: link: `/usr/sfw/lib/libstdc++.la' is not a valid libtool archive
*** Error code 1
make: Fatal error: Command failed for target `Magick++/lib/libMagick++.la'
# 
#

sorry for the long post. I have attached my error log file for both GD and imagemagick.

Thanks
rohit
# 2  
Old 08-21-2006
Some old objects may have left around. Try to run

gmake distclean

in your PHP build area first. Then rerun configure. Also enable --enable-iconv when you run configure, and make sure the "iconv" library exists on your system and be locatable by PHP.

Also, if you use any external GD installations instead of the bundled version, it may not necessarily work. Your mileage may vary. If everything fails, use the bundled version.
# 3  
Old 08-21-2006
Hi,

Thanks for you reply.

Thats what I wanted to know, how to make PHP pick up the built in extension of GD as it didn't install it in the first go.....

second of all, do i need to run gmake distclean under /php-5.1.4. This folder is the main forlder with all the files which i downloaded from php.net.

cheers
rohit
# 4  
Old 08-22-2006
hi cbkihong,

i tried what you suggested but got the same set of errors as last time.....
Code:
Undefined                       first referenced
 symbol                             in file
libiconv_close                      ext/gd/libgd/.libs/gdkanji.o
libiconv_open                       ext/gd/libgd/.libs/gdkanji.o
libiconv                            ext/gd/libgd/.libs/gdkanji.o
ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
gmake: *** [sapi/cli/php] Error 1

Thanks
rohit
# 5  
Old 08-22-2006
What about compiling with the bundled version of GD? You don't need to do anything. As GD is bundled, you just need to have the full PHP sources there, pass the "--with-gd" option to configure (or additional ones. Run "configure --help" for a list) then it should pick it up. Always remember to "gmake distclean". Forgetting to do so frequently causes mysterious compilation errors. You may need to remove your installed version of GD. It may probably cause problems.

I noticed from your logs that the linking command (that is failing) in the auto-generated Makefile does not include "-liconv", but your GD object apparently requires iconv, so there is this error. This probably indicates it is not compatible with PHP.

Are you sure GD is really not loaded in PHP? Did you restart your Apache? It should be linked into the PHP binary/libphp5.so instead of being a PHP extension.

Last edited by cbkihong; 08-22-2006 at 01:16 AM..
# 6  
Old 08-22-2006
I've modified the ./configure command to the following
Code:
./configure   --with-gd \
              --with-zlib-dir="/usr" \
              --with-png-dir="/usr/local" \
              --with-jpeg-dir="/usr/local" \
              --enable-gd-native-ttf --with-freetype-dir=/usr \
              --with-libxml-dir=/usr/local \
              --with-iconv-dir=/usr/local

Its running right now as we speak....I wanted to know, is there any change I would need to make in PHP.ini file. Also, when I run phpinfo on my server, I do see iconv listed as enabled and a few other parameters within it as enabled.

thanks
rohit
# 7  
Old 08-22-2006
gmake is now running.

If this fails again, what options do i have. Is it possible to completely uninstall PHP from my sun box ? if so, how to do an uninstall. Secondly, I'll download
php-5.1.4.tar.gz again and to compile it with all the extenions what commands would I need to do. Because when I compiled it on my own, it left out GD and many more, it only installed a few.

Thanks
rohit
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Error while starting Apache after compiling PHP and Curl

Hello, I am facing an issue while starting the apache server after compiling php and curl. Below are the versions i am using. php-5.2.17 httpd-2.2.17 curl-7.16.0 CentOS5.5x64 Compiling above packages without curl working very fine but when trying to compile php with curl below error is... (1 Reply)
Discussion started by: sunnysthakur
1 Replies

2. UNIX Benchmarks

error compiling bm software under Solaris 10

anyone tried it , under Solaris 10 using make (part of SUNWsprot) and gcc 4.6 compiler.. got an error complaining about the Makefile script syntax... I don't think that's compatible at all... (2 Replies)
Discussion started by: ppchu99
2 Replies

3. HP-UX

Compiling php 5.3.3 on HP-UX 11.23

Hi, I'm trying to compile php 5.3.3 on HP 11.23 We've installed all the pre-requirements packages. Here is the configure: ./configure --prefix=/usr/local/php.5.3.3 --with-mysqli=mysqlnd --enable-libxml --with-libxml-dir=/usr/local/libxml2-2.7 --disable-dom The configure has no problem... (0 Replies)
Discussion started by: Yomtov
0 Replies

4. Solaris

Compiling Error in Samba 3.4.1 on Solaris 10

Hi all, I am getting the following error While installing Samba 3.4.1 on Solaris 10. #./autogen.sh ./autogen.sh : autoheader : not found ./autogen.sh : test : argument expected Please help me as I am in a critical state of the project. Warm regards, Sathya (10 Replies)
Discussion started by: sathya47
10 Replies

5. Programming

Sun Solaris C++ Compiling Error

Hello. I'm using SunStudio 12 Update 1. When compiling for x86, everything works fine. When compiling for SPARC, I get the following errors. I linked libCstd.so.1 explicitly, but I get the same errors. Would anyone be kind enough to step me through resolving this? Thank you very much. **... (2 Replies)
Discussion started by: acheong87
2 Replies

6. Infrastructure Monitoring

compiling netsnmp on solaris 8

Hello all Currently I am trying to install net-snmp-5.5 on a V480 Solaris 8 machine however things are hardly going smooth. I'm running configure will the following options. ./configure --prefix=/usr/local --with-mib-modules="smux ucd-snmp/diskio ucd-snmp/lmSensors host"... (2 Replies)
Discussion started by: krabu
2 Replies

7. Solaris

Compiling IRSSI on Solaris 10

How does one go aout compiling irssi locally on a fresh installation of Solaris 10, Out put from ./configure m command /download/1rss1-0.8.12 checking for a BSD-compatible install... ./install-sh -c checking whether build environment is sane... yes checking for gawk... no checking... (2 Replies)
Discussion started by: FloridaBSD
2 Replies

8. UNIX for Advanced & Expert Users

compiling php5 on solaris 9. please help.

I'm trying to compile PHP5. I've installed mysql5 successfully and apache1.3 is working great, but I get the message below when I compile PHP5. I double checked if I have libxml2 installed and I do. I installed libxml2 binary from sunfreeware. Please see below for details: ./configure... (5 Replies)
Discussion started by: xnightcrawl
5 Replies

9. Programming

Compiling in Solaris

Hi, I'm new to Unix. I'm trying to compile a shared library in Solaris running on x86. I get "void value not ignored as it ought to be" error when trying "make". But it compiles fine in Fedora. How can this happen? I think both are using the same type of compiler. What can I do to get around... (8 Replies)
Discussion started by: runnerb
8 Replies

10. UNIX for Dummies Questions & Answers

get error while compiling apache with php module

hi, i'm compiling apache with php module after i finish compile mysql-4.0.0-alpha. i do it as the follow steps after untar'ed them in the same directory, 1) cd apache_1.3.22 ./configure 2) cd php-4.0.6 ./configure --with-mysql=/usr/local/mysql \ --with-apache=../apache_1.3.22 \... (2 Replies)
Discussion started by: jApHEth
2 Replies
Login or Register to Ask a Question