Bug #56556 Failure when compiling php 5.3.3( with mysql 5.1.50 installed)
Submitted: 4 Sep 2010 1:45 Modified: 7 Sep 2010 10:22
Reporter: Alex Jiang Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version: OS:Linux (Debian Squeeze)
Assigned to: CPU Architecture:Any
Tags: my_compiler.h, mysql5.1.50, php 5.3.3

[4 Sep 2010 1:45] Alex Jiang
Description:
I have installed mysql 5.1.50, php 5.2.14 with php-fpm
I want to install php 5.3.3 with:
'--with-mysql=/usr/local/mysql'
'--with-mysqli=/usr/local/mysql/bin/mysql_config
but it said:

/usr/local/mysql/include/mysql/my_global.h:626:25: error: my_compiler.h:
No such file or directory

make: *** [ext/mysqli/mysqli.lo] Error 1
I found someone had the same problem here:

http://www.directadmin.com/forum/showthread.php?p=186047

He said after downgrade mysql to 5.1.49, everything works fine.

How to repeat:
with mysql 5.1.50 installed:
./configure --prefix=/usr/local/mysql --with-extra-charsets=all --enable-thread-safe-client --enable-assembler --with-charset=utf8 --enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline --with-ssl --with-embedded-server --enable-local-infile

=============================================
then install php 5.3.3

cd php-5.3.3

./buildconf --force

'./configure' '--prefix=/usr/local/php'
'--with-config-file-path=/usr/local/php/etc'
'--with-mysql=/usr/local/mysql'
'--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-iconv-dir'
'--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib'
'--with-libxml-dir=/usr' '--enable-xml' '--enable-safe-mode'
'--enable-bcmath' '--enable-shmop' '--enable-sysvsem'
'--enable-inline-optimization' '--with-curl' '--with-curlwrappers'
'--enable-mbregex''--enable-fpm''--enable-mbstring' '--with-mcrypt'
'--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-openssl'
'--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc'
'--enable-zip' '--enable-soap' '--with-pear' '--with-gettext'
'--enable-exif'  '--with-fpm-user=www'  '--with-fpm-group=www'

make all install

it will say

/usr/local/mysql/include/mysql/my_global.h:626:25: error: my_compiler.h:
No such file or directory

make: *** [ext/mysqli/mysqli.lo] Error 1

Suggested fix:
fix the my_compiler.h
I reported this problem to php developers but they said it is a bug in mysql.
[4 Sep 2010 8:21] Valeriy Kravchuk
Looks like a duplicate of bug #55846, but on Debian. What exact binaries you had used (URL, please)?
[4 Sep 2010 8:47] Alex Jiang
I compiled mysql 5.1.50 from source code.  And I received error during compiling php 5.3.3 after installed mysql 5.1.50.
The mysql source code is:
http://www.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.50.tar.gz/from/http://mysql.he.net/
The php 5.3.3 source code is:
http://us.php.net/get/php-5.3.3.tar.gz/from/this/mirror
[4 Sep 2010 8:59] Valeriy Kravchuk
What exact configure command line you had used when compiling from source?
[4 Sep 2010 9:06] Alex Jiang
As it is shown above in "how to repeat" section:
I compile mysql 5.1.50 
======================================
cd mysql-5.1.50

./configure --prefix=/usr/local/mysql --with-extra-charsets=all
--enable-thread-safe-client --enable-assembler --with-charset=utf8
--enable-thread-safe-client --with-extra-charsets=all --with-big-tables --with-readline
--with-ssl --with-embedded-server --enable-local-infile

make

make install
==========================================
I compile php 5.3.3 with:
=================================
cd php-5.3.3

./buildconf --force

'./configure' '--prefix=/usr/local/php'
'--with-config-file-path=/usr/local/php/etc'
'--with-mysql=/usr/local/mysql'
'--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-iconv-dir'
'--with-freetype-dir' '--with-jpeg-dir' '--with-png-dir' '--with-zlib'
'--with-libxml-dir=/usr' '--enable-xml' '--enable-safe-mode'
'--enable-bcmath' '--enable-shmop' '--enable-sysvsem'
'--enable-inline-optimization' '--with-curl' '--with-curlwrappers'
'--enable-mbregex''--enable-fpm''--enable-mbstring' '--with-mcrypt'
'--enable-ftp' '--with-gd' '--enable-gd-native-ttf' '--with-openssl'
'--with-mhash' '--enable-pcntl' '--enable-sockets' '--with-xmlrpc'
'--enable-zip' '--enable-soap' '--with-pear' '--with-gettext'
'--enable-exif'  '--with-fpm-user=www'  '--with-fpm-group=www'

make all install
==================================
[5 Sep 2010 16:16] Iain Kay
This is easily fixed. After running 'make install' during the source installation process, simply fire off the following command:

cp /usr/local/src/mysql-5.1.50/include/my_compiler.h /usr/local/mysql/include/mysql/my_compiler.h

PHP 5.3.3 will now build the mysqli module with MySQL 5.1.50 from source.
[6 Sep 2010 23:47] Iain Kay
One can also avoid this bug by using a different php compile line.

./configure --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd
[7 Sep 2010 10:22] Davi Arnaut
Closed as a duplicate of Bug#55846.