LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-01-2006, 02:41 AM   #1
kamran_pro
LQ Newbie
 
Registered: Sep 2005
Posts: 28

Rep: Reputation: 15
PHP 5 configure error with mysql


I have installed apache2 in /usr/local/apache2 and mysql in /usr/local/mysql. I configure PHP 5 with the following line:

./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql

PHP configures fine, finding include files etc. from mysql directory. However when I make PHP, I get the following error:

ext/mysql/.libs/php_mysql.o(.text+0x21b2): In function `zif_mysql_create_db':
/usr/src/php/ext/mysql/php_mysql.c:1176: undefined reference to `mysql_create_db'
ext/mysql/.libs/php_mysql.o(.text+0x23cd): In function `zif_mysql_drop_db':
/usr/src/php/ext/mysql/php_mysql.c:1218: undefined reference to `mysql_drop_db'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1


I would be grateful if someone can explain this problem to me.
 
Old 02-01-2006, 06:09 AM   #2
mushroomboy
Member
 
Registered: Jan 2006
Distribution: Debian Testing ALWAYS!!!
Posts: 363

Rep: Reputation: 43
Try dropping the --with-mysql=/blah blah and just try --with-mysql? I had to compile PHP on a crap fedora computer and got it working so I know it's possible. Your just not setting the mysql flag properly I'm betting.
 
Old 02-05-2006, 07:28 AM   #3
kamran_pro
LQ Newbie
 
Registered: Sep 2005
Posts: 28

Original Poster
Rep: Reputation: 15
Dropping it make PHP unconfigurable in the first place.

By pointing to mysql dir, configure works fine (it even finds mysql libs). The problem appears when compiling. It has to do something with linking.
 
Old 02-05-2006, 09:37 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,900

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
What version of mysql are you using and how did you installed it?
 
Old 02-05-2006, 03:15 PM   #5
kamran_pro
LQ Newbie
 
Registered: Sep 2005
Posts: 28

Original Poster
Rep: Reputation: 15
MySql 5.0 installed from source with configure, make, make install.
 
Old 02-06-2006, 03:34 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,900

Rep: Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611Reputation: 1611
It seems that with php5 and mysql5 you have to use:
Code:
./configure --with-mysqli=/path/to/mysql_config
because there is no support for mysql greater that 4.1 in the bundled libraries. You can take a look at this FAQ for details.
 
Old 07-17-2007, 04:12 AM   #7
fredsub
LQ Newbie
 
Registered: Jul 2007
Posts: 7

Rep: Reputation: 0
I think it is a configure problem.
I used the --with-mysql=/usr/local/mysql

and still get in the compile I can see gcc .....-I/usr/include/mysql

(which is old install,
I deleted /usr/include/mysql
and
ln -s /usr/local/mysql/include /usr/include/mysql

and got a successful php build.

gee, isn't it time to relegate configure/autoconf tool to the dinosoaur dustbin, and use something that is easier to modify/comprehend and fix.
 
Old 08-15-2007, 09:00 AM   #8
Stefan Pantiru
LQ Newbie
 
Registered: Apr 2004
Location: Iasi, Romania
Distribution: Gentoo && Fedora
Posts: 9

Rep: Reputation: 0
On FC3

In my case, on a Fedora Core 3 I had to

Code:
rm -Rf /usr/include/mysql/
ln -s /usr/src/redhat/BUILD/mysql-4.1.22/include/ /usr/include/mysql
But it took me a looong time to figure that out, and I'm not sure why I had two source directories since everything was installed via yum.

Last edited by Stefan Pantiru; 08-15-2007 at 09:01 AM.
 
  


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
apache 2, php 5 and mysql 5 install and configure librano Linux - Enterprise 3 11-13-2005 06:52 AM
PHP ./configure command dilema (for mysql) tuka Linux - Newbie 2 11-03-2003 10:26 PM
Configure Apache, PHP and MySQL on RedHat 9.0 siripr Linux - Newbie 2 10-21-2003 03:35 PM
How do i configure RH-9, apache 2.0, php and mysql rolling_titan Linux - General 4 10-18-2003 07:56 AM
php 4.3.2 configure error adrianmak Linux - Software 0 06-19-2003 09:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:48 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration