Topic: Couldn't build PHP 5.4 because mysql_config not found

checking for mysql_close in -lmysqlclient... yes
checking for MySQL UNIX socket location... no
checking for MySQLi support... yes, shared
checking whether to enable embedded MySQLi support... no
mysql_config not found
configure: error: Please reinstall the mysql distribution
error: Bad exit status from /var/tmp/rpm-tmp.CrOQDX (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.CrOQDX (%build)
[root@p5k mikhail]# find / -name mysql_config
find: `/run/user/mikhail/gvfs': Permission denied
/usr/bin/mysql_config
find: `/proc/21621/task/21621/ns/net': No such file or directory
find: `/proc/21621/task/21621/ns/uts': No such file or directory
find: `/proc/21621/task/21621/ns/ipc': No such file or directory
find: `/proc/21621/ns/net': No such file or directory
find: `/proc/21621/ns/uts': No such file or directory
find: `/proc/21621/ns/ipc': No such file or directory
[root@p5k mikhail]#

But I install MariaDB-devel and mysql_config is present at /usr/bin/ why buils script couldn't find it?

Re: Couldn't build PHP 5.4 because mysql_config not found

my .rpmmacros


%_topdir /root/rpmbuild/
%fedora 17
%_with_oci8 1
%_with_ibase 1

Re: Couldn't build PHP 5.4 because mysql_config not found

Because the spec expects to find it in /usr/lib64/mysql/mysql_config, as provided by MySQL fedora package.

Desktop: Fedora 29 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 28 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test

Re: Couldn't build PHP 5.4 because mysql_config not found

Remi wrote:

Because the spec expects to find it in /usr/lib64/mysql/mysql_config, as provided by MySQL fedora package.

This is not 64 bit server, i compiled at home desktop i386 version.

5 (edited by NT Man 2012-04-01 19:42:49)

Re: Couldn't build PHP 5.4 because mysql_config not found

I am create symbolic links:
/usr/lib/mysql/mysql_config -> /usr/bin/mysql_config
/usr/lib/mysql/libmysqlclient.so -> /usr/lib/libmysqlclient.so
/usr/lib/mysql/libmysqlclient_r.so -> /usr/lib/libmysqlclient_r.so

And building ended successful.

Why for better compatibility with MariaDB change the search path?
Search mysql_config in /usr/bin, libmysqlclient.so in /usr/lib, libmysqlclient_r.so in /usr/lib

Re: Couldn't build PHP 5.4 because mysql_config not found

As long as your don't have multiple, possibly untrusted, users on your machine then that's OK.  But when you are running a large multi-user service with thousands of users its always possible that one of them will look at your.