|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40741 Change mysql compilation
Submitted: 2007-03-06 18:53 UTC Modified: 2007-03-07 10:09 UTC
From: d dot huijbers at apollo-ict dot nl Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.2.1 OS: FreeBSD
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: d dot huijbers at apollo-ict dot nl
New email:
PHP Version: OS:


 [2007-03-06 18:53 UTC] d dot huijbers at apollo-ict dot nl
I've been trying to compile php-5.2.1 with mysql 5.1.x on my system which also has mysql3.x.x installed in /usr/local/mysql. I installed mysql-5.1.x into /usr/local/mysql5. Now, when I use --with-mysql=/usr/local/mysql5/ it still compiles to the libs in /usr/local/mysql/lib/.... 

I fixed this for my compilation by renaming the /usr/local/mysql into /usr/local/mysql3 for the compilation time.

Reproduce code:
./configure \
  --disable-all \
  --enable-safe-mode \
  --with-apxs2=/usr/local/apache2/bin/apxs \
  --prefix=/usr/local/apache2/php5 \
  --with-config-file-path=/usr/local/apache2/php5 \
  --enable-track-vars \
  --enable-ftp \
  --enable-pcre-regex=yes \
  --with-pdf-lib \
  --with-session \
  --enable-session \
  --with-zlib-dir=/usr/include \
  --with-freetype-dir=/usr/local/include/freetype2 \
  --with-bz2 \
  --with-xml \
  --with-libxml-dir=/usr/local/include/libxml2 \
  --with-curl=/usr/local/include/curl/ \
  --enable-curlwrappers \
  --enable-versioning \
  --enable-xml \
  --with-gd \
  --with-ttf \
  --with-xml-rpc \
  --enable-libxml \
  --with-dom \
  --with-mcrypt \
  --with-gettext \
  --enable-exif \
  --enable-bcmath \
  --enable-calendar \
  --enable-gd-native-ttf \
  --enable-gd-jis-conv \
  --with-kerberos \
  --enable-mbstring \
  --with-libmbfl \
  --with-mcve \
  --with-mhash \
  --with-mime-magic \
  --with-ncurses \
  --enable-shmop \
  --enable-dom \
  --enable-libxml \
  --enable-soap \
  --enable-sockets \
  --without-sqlite \
  --enable-sysvmsg \
  --enable-sysvmem \
  --enable-sysvshm \
  --with-iconv-dir \
  --with-xsl \

Expected result:
Just a correct compilation of php-5.2.1 which is linked against /usr/local/mysql5 (a mysql 5.1.x installation)

Actual result:
PHP compiled against my older mysql3 installation that is found in /usr/local/mysql/ 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-03-06 19:02 UTC]
These lines are incorrect:
  --with-zlib-dir=/usr/include \
  --with-freetype-dir=/usr/local/include/freetype2 \
  --with-libxml-dir=/usr/local/include/libxml2 \
  --with-curl=/usr/local/include/curl/ \
The values are supposed to be prefixes, i.e. /usr or /usr/local.

Where did you install MySQL headers? (mysql.h particularly)
 [2007-03-06 23:10 UTC] d dot huijbers at apollo-ict dot nl
I installed the mysql.h into both /usr/local/mysql/include/... for mysql 3.x and for mysql 5.x into /usr/local/mysql5/include/

 [2007-03-07 07:36 UTC]
ls -l /usr/local/mysql5/include/mysql.h
 [2007-03-07 08:16 UTC] d dot huijbers at apollo-ict dot nl
-rw-r--r--  1 mysql  wheel  33723 Mar  6 14:49 mysql.h
 [2007-03-07 08:28 UTC]
ldd ./sapi/cli/php ?
 [2007-03-07 08:53 UTC] d dot huijbers at apollo-ict dot nl
After a day compiling, I found out that when I renamed the directory 
/usr/local/mysql to /usr/local/mysql3 and than used --with-mysql=/usr/local/mysql5 (my other mysql installation) id worked. Therefore I do not have a 'old' ./sapi/cli/php, but I'm quite sure it linked against not 


ldd php
php: => /lib/ (0x284f5000) => /usr/local/lib/ (0x2850d000) => /lib/ (0x2851d000) => /lib/ (0x2852d000) => /usr/lib/ (0x28547000) => /lib/ (0x2854b000) => /usr/local/lib/ (0x2858a000) => /usr/local/lib/ (0x285be000) => /usr/local/lib/ (0x285ee000) => /usr/local/lib/ (0x285f6000) => /usr/local/lib/ (0x285ff000) => /usr/local/lib/ (0x28663000) => /usr/lib/ (0x28685000) => /usr/local/lib/ (0x28694000) => /usr/lib/ (0x286c8000) => /lib/ (0x286f6000) => /usr/local/mysql5/lib/mysql/ (0x287eb000) => /usr/local/lib/ (0x28848000) => /usr/local/lib/ (0x28879000) => /usr/local/lib/ (0x28991000) => /lib/ (0x28a7e000)
 [2007-03-07 09:06 UTC]
Ah, so it DOES work when you fix the mess with MySQL libs.
Ok, then I don't see any sense to keep this report open.
 [2007-03-07 10:09 UTC] d dot huijbers at apollo-ict dot nl
Well I do think it's important that when one specifies --with-mysql=/path/to/mysql/to/be/used those libs are actually used and  not another lib as is the case now.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Sep 25 23:01:26 2023 UTC