Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have tried a number of tutorials, and keep coming up with this error (for both php-5-3.0 & php-5.2.10) when I run "make" after running configure (as seen below)
Code:
/usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
$ ./configure --prefix=/usr/local/php5 --with-apxs2=/usr/local/apache2/bin/apxs --with-libdir=/lib64
$ make
and still got the same error after running make.
Code:
:
:
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
In terms on apache version, you are correct, I have built from source and run "make" "make install" for the lastest version of apache, and trying to compile php5 with apache 2.2.13
I have installed (or thought i installed) the latest version of apache, but when I run
Code:
$ apachectl -v
I still get
Code:
[root@web2 ~]$/usr/sbin/apachectl -v
Server version: Apache/2.0.52
Server built: May 9 2008 05:55:16
bathory,
Thanks for your help! I looked at that post, and added the 2 items to the configure script, ran configure and make (same error). Then added "include /usr/local/lib to the /etc/ld.so.conf file and ran "ldconfig", yet still same error.
any reason apachectl -v still shows the older version of apache ?
Not much help, but with regards to your first code block in post #1
When you are in the directory php-5.2.10 and you execute the php -v command, it will execute the command that is in the PATH, not the one in that directory. You can use ./php -v to execute a command that is in the current directory.
/usr/bin/ld: /usr/local/lib/libz.a(crc32.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
Why ld is using the libraries from /usr/local/lib? Is it the 1st entry in /etc/ld.so.conf, or you have set a LD_LIBRARY_PATH with /usr/local/lib as 1st entry?
IIRC there is also a "bug" with the libz and libpng used at compile time. I think that ./configure picks the 32 bit libs
You can overcome to this using:
:
:
_functions.lo -lcrypt -lcrypt -lrt -lpng -lz -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -lxml2 -lz -lm -lxml2 -lz -lm -lxml2 -lz -lm -lcrypt -o libphp5.la
/usr/bin/ld: /usr/local/lib/libz.a(compress.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libz.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
I am not configuring with mysql, i don't understand why this is even necessary. I can't be the only person with this issue?
If I run php config without any options, it works properly and then php -v reports:
yes, after every make "re-try" i run "make distclean", then re-configure and re "make".
And maybe im missing something with apache. I downloaded the 2.2 source and installed it (as instructions say). Configure, make, make install. Ive stopped service, and rebooted machine, but "httpd -v" reports previous verions??
Code:
[root@web2 ~]$/usr/local/apache2/bin/httpd -V | grep version
Server version: Apache/2.2.13 (Unix)
[root@web2 ~]$httpd -v
Server version: Apache/2.0.52
Server built: May 9 2008 05:55:16
[root@web2 ~]$
I also tried to use the LD as you instruct, then run config, then make, and still get:
Code:
:
:
ext/xmlreader/.libs/php_xmlreader.o(.text+0x135c): In function `zim_xmlreader_setSchema':
/root/SRC/php-5.2.10/ext/xmlreader/php_xmlreader.c:983: undefined reference to `xmlTextReaderSchemaValidate'
ext/xmlreader/.libs/php_xmlreader.o(.text+0x160b): In function `zim_xmlreader_XML':
/root/SRC/php-5.2.10/ext/xmlreader/php_xmlreader.c:1109: undefined reference to `xmlTextReaderSetup'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
And maybe im missing something with apache. I downloaded the 2.2 source and installed it (as instructions say). Configure, make, make install. Ive stopped service, and rebooted machine, but "httpd -v" reports previous verions??
That's because /usr/local/apache2/bin isn't in your PATH. If your apache build is 32 bit you cannot use a php module compiled for 64 bit.
The error you get now is different. You must scroll up the make output until you find what the real error is (some missing header file maybe).
Also I guess you ran ldconfig when you change the libs order in /etc/ld.so.conf.
BTW what distro are you using? Aren't there any 64 bit apache-2.2.x and php5 packages for it?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.