Portal Home > Knowledgebase > Articles Database > php compile


php compile




Posted by PirateSolutions, 01-02-2010, 08:39 AM
hello, I'm getting this error while I'm compiling php - 5.2.12 /usr/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 What i'm doing wrong?

Posted by DigitalLinx, 01-02-2010, 08:42 AM
Which OS/Distro are you using? On Centos/RHEL you'd need

Posted by PirateSolutions, 01-02-2010, 08:51 AM
Thanks, it worked but now it came up another problem with '--with-mysql' configure: error: mysql configure failed. Please check config.log for more information. config.log says this: configure:60376: checking for mysql_error in -lmysqlclient configure:60395: gcc -o conftest -I/usr/include -g -O2 -Wl,-rpath,/usr/lib/mysql -L/usr/lib/mysql -L/usr/lib -Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient -lz -lfreetype -lpng -lz -ljpeg -lz -lresolv -lm -ldl -lnsl -lxml2 -lz -lm -lxml2 -lz -lm 1>&5 /usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.so when searching for -lmysqlclient /usr/bin/ld: skipping incompatible /usr/lib/mysql/libmysqlclient.a when searching for -lmysqlclient /usr/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status configure: failed program was: #line 60384 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mysql_error(); int main() { mysql_error() ; return 0; }

Posted by PirateSolutions, 01-02-2010, 08:55 AM
I installed mysql via yum liike yum install mysql mysql-server mysql*

Posted by DigitalLinx, 01-02-2010, 09:24 AM
yum install mysql-devel Is there a reason you're compiling php from source?

Posted by jai_hoo, 01-02-2010, 01:04 PM
After installing mysql, you need to verify whether the daemon is running. ================= rpm -qa | grep mysql && chkconfig --list | grep mysql ================ ps -ax | grep mysql =========== Once this give a positive response, you would be able to compile php from the source. Does the server have any control panel installed ??

Posted by PirateSolutions, 01-02-2010, 03:08 PM
Hello, mysql-devel is already installed and mysqld is running, just checked. Still have the same issue though No, the server doesn't have a control panel installed.everything has to be done via ssh

Posted by DigitalLinx, 01-02-2010, 03:11 PM
I suggest using the pre-built rpm packages instead. It's easier, faster and dependencies are resolved automatically with yum and if you need additional php modules built you don't have to recompile php. For example you can just issue yum install php-gd if you need the gd module. Run yum search php to check which php versions and modules your yum repo has so you can get everything running in no time.

Posted by PirateSolutions, 01-02-2010, 03:24 PM
Thanks for solution but I would like to get it fixed in my way, by compiling via SSH. Forgot to mention, I'm using CentOS 5, 64-bit. Never had that problem with CentOS 5 32-bit though and I was doing everything same as I'm doing now.

Posted by PirateSolutions, 01-02-2010, 04:19 PM
I was googing about it and it seems it has something to do with 64bit version of an OS which I'm running. Any ideas?

Posted by karelbarel, 01-04-2010, 07:52 AM
This isn't true. You can compile php with mysql support without installing/running mysql-server. You need mysql headers and libraries only.

Posted by karelbarel, 01-04-2010, 08:02 AM
Maybe you don't known, if you are compiling on 64b box, you must provide '--with-libdir=lib64' param.

Posted by VIPoint, 01-04-2010, 08:20 AM
yeah You should specify that you using a 64 Bit by "--with-libdir=lib64". Also mysql and mysql-devel should be installed.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
Northtrex.com prices (Views: 568)