Link to home
Start Free TrialLog in
Avatar of ChadMarsh
ChadMarshFlag for United States of America

asked on

Compiling with MySQLi

Hello Experts,
I have been trying to compile and install php with the MySQLi extensions.  My Linux Dist. is FC4. So far I have not had any luck.
I have MySQL 5.0.22 installed on the same box (this is a development box). Does anyone have a step by step set of instructions that
states what I need and what commands to issue? I've been bouncing back and forth between the MySQL and PHP help documents, and
find they it's hard to get a clear cut answer on just what I'm really supposed to do.
So far I have downloaded php-5.1.4.tar.gz, unpackaged it and tried to do ./configure --with mysqli=/usr/bin. It keeps telling me that I have the wrong MySQL client, but I have the 5.0.22 client installed also.
Thanks for any help.
Chad
Avatar of ChadMarsh
ChadMarsh
Flag of United States of America image

ASKER

Here is the exact error

checking whether to enable embedded MySQLi support... no
checking for mysql_set_server_option in -lmysqlclient... no
configure: error: wrong mysql library version or lib not found. Check config.log for more information.
> It keeps telling me that I have the wrong MySQL client, but I have the 5.0.22 client installed also.
ok, then you first need to identify the correct mysql client and libraries. How did you install mysql 5.x?
Try with
  mysql -V
  which mysql
  ldd `which mysql`
and post result
[root@mercedes ~]# mysql -V
mysql  Ver 14.12 Distrib 5.0.22, for pc-linux-gnu (i686) using readline 5.0

[root@mercedes ~]# which mysql
/usr/bin/mysql

[root@mercedes ~]# ldd `which mysql`
        not a dynamic executable

Thanks
sounds like you're missing the includes of mysql 5.x
How did you install MySQL 5.x, using rpm? then you need to install a devel package also.
I did use an RPM and I have the MySQL-devel 5.0.22-0 package installed.

I used the RPM's from this section "Linux x86 generic RPM (statically linked against glibc 2.2.5) downloads"
on the MySQL website.
depending on where you have installed your mysql-5.0.22 libs try using

./configure --with-mysqli=/usr
or
./configure --with-mysqli=/usr/local/mysql

How did you install those mysql 5.0.22 libs?
I'll try those configure commands.
I used RPM's also to install the libs.
Both commands produced the following:

checking for MySQLi support... yes
checking whether to enable embedded MySQLi support... no
mysql_config not found
configure: error: Please reinstall the mysql distribution

Do you think it would be wise to uninstall all of those RPM's and start over?
My mysql_config file resides in /usr/bin
> I used RPM's also to install the libs.
the RPMs should tell your where it installs, try
   rpm -ql ....
They look like they are in the logical folders. Is there anything specific you would like to see?
I'm getting close to rebuilding the whole box and loading everything with tar files..
> logical folders.
please post the path where the include files and libs are installed
Did you used the rpm from FC4 or from the mysql-page? If you used FC4 make sure also the mysql-devel rpm is installed also
I went ahead and took out my RPM install and re-installed it from a tar
My lib folder is /usr/local/mysql-max-5.0.22-linux-i686/lib  I'm thinking this is not right.
My include folder is /usr/local/mysql-max-5.0.22-linux-i686/include

I did set up a link to access those folders from /usr/local/mysql
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for the help. I ended up reinstalling FC4 with the default php and mysql, then I upgraded mysql with the 5.0.22 RPM.
Still a little buggy, but it's working.