LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Search this Thread
Old 08-18-2007, 07:40 PM   #1
LDZ420
LQ Newbie
 
Registered: Apr 2004
Location: Fontana, California
Distribution: Ubuntu
Posts: 27
Blog Entries: 1

Rep: Reputation: 15
Ubuntu amd64 (x86_64)version 7.04 issues with compiling php from source


Hi

I am a Linux rookie so here we go.
I am trying to install php 5.2.3 on my ubuntu machine
(yes I do understand that I could easily install ubuntu's packaged version
which is 5.2.1 but I wanted to grow in learning about compiling from source) moreover, while trying to install php am able to ./configure the php source but when trying to use make i get an error

"
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64/libxml2.a(entities.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.1.2/../../../../lib64/libxml2.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [libphp5.la] Error 1
"
- gcc version is 4.1.2
- I have apache2 installed
- I used --enable-so when configuring apache
- i have set apxs2= /path/to/apxs
- I have search on different search engines
-I used "sudo ./configure --prefix=/usr/local/web --with-apxs2=/path/to/apxs" to config installation


- I tried using make clean still didn't work
- when using ./configure --prefix=/usr/local/web (no apxs) " to config installation make seems to work fine.

any assistance will be appreciated.
if there is a better place to post this error or necessary information is missing please inform me &
 
Old 08-18-2007, 09:21 PM   #2
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,747
Blog Entries: 1

Rep: Reputation: 225Reputation: 225Reputation: 225
You're trying to use the statically built libxml archive which isn't PIC-enabled. When GCC is given the -l flag to link to a library (libxml in this case), it falls back to the static archive when it can't find a shared library. Ideally, you would rebuild libxml and enable the shared library (which should be default anyway). At least you need to rebuild the static libxml using the -fPIC flag.
 
Old 08-20-2007, 09:02 PM   #3
LDZ420
LQ Newbie
 
Registered: Apr 2004
Location: Fontana, California
Distribution: Ubuntu
Posts: 27
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Do you have a link that can show me how to rebukd a static library. I have researched and tried and have only failed.
 
Old 08-20-2007, 09:35 PM   #4
LDZ420
LQ Newbie
 
Registered: Apr 2004
Location: Fontana, California
Distribution: Ubuntu
Posts: 27
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Sorry.. I mean.. can you find a link to a site that can show me how to do this?
Forgive me of my ignorance.
 
Old 08-20-2007, 11:14 PM   #5
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware-current, Cross Linux from Scratch, Gentoo
Posts: 2,747
Blog Entries: 1

Rep: Reputation: 225Reputation: 225Reputation: 225
You have to add -fPIC to CFLAGS/CXXFLAGS or pass it to gcc when you build the library. The way I would do it (although libxml2 should build PIC-enable by default) on my x86_64 machine
Code:
CC="gcc ${BUILD64} -fPIC" ./configure --prefix=/usr --libdir=/usr/lib64 &&
make &&
su -c 'make install'
Where ${BUILD64} is a list of the build options I use for everything.
 
Old 08-23-2007, 08:24 AM   #6
LDZ420
LQ Newbie
 
Registered: Apr 2004
Location: Fontana, California
Distribution: Ubuntu
Posts: 27
Blog Entries: 1

Original Poster
Rep: Reputation: 15
Hey,

so it seems that you were completely correct. The reason for my problem seems to be that i had a broken symbolic link to libxml2.so in my /usr/lib64 There was a file named libxml2.so.2 which seemed to be pointing to a latter version of libxml2.so. I had assumed that php was recognizing this file as my libxml2.so.. I thought that possibly renaming this link would fix it but I though couldn't be.. well i finally decided to go against my own expectations and well it worked( yes yes I am a newbie).

And no matter how ridiculous I feel about how long it took me to solve this issue. I am amazed at all of the other things that I learned while researching this issue. That I would have never spent my time learning. weibullguy.. I thank you for helping this community to work for people like me.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
does compiling from source avoid kernel version probs? disorderly Linux - Newbie 1 03-25-2005 04:28 PM
problems with compiling from source PKG_CONFIG_PATH ISSUES Nadim Slackware 7 01-20-2005 05:37 PM
PHP compiling issues turbo_acura Linux - General 6 10-15-2004 11:17 AM
Compiling programs from source in Mandrake 10 AMD64 RC1 hydroxy Linux - Software 7 05-12-2004 03:55 PM
Compiling Evolution 1.4 issues on Slackware 9 (incompatible db3 version) Obi-Wan_Kenobi Slackware 2 06-11-2003 11:54 AM


All times are GMT -5. The time now is 07:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration