简体   繁体   中英

Installing php from source and mysql cant find the header files

i have read some of the existing topics and have not found the answer. I am trying to install php from source. I wish there was just a rmp package i could install but i have not found one.

So i have to build the install. I have all the dependencies installed (finally lol) however i am having an issue with the configuration finding the mysql header files.

I am using webmin, but i am doing the submit right from the ssh box on another monitor so its not a webmin issue.

Here are the packages i have installed

mysql-community-client 5.7.14-1.el6

mysql-community-common 5.7.14-1.el6

mysql-community-devel 5.7.14-1.el6

mysql-community-libs 5.7.14-1.el6

mysql-community-libs-compat 5.7.14-1.el6

mysql-community-server 5.7.14-1.el6

mysql57-community-release el6-8

i am on linux CentOs6 64bit dedi server and here is the message i am getting.

configure: error: Cannot find MySQL header files under /usr/include/mysql Note that the MySQL client library is not bundled anymore!

i have tried:

/usr/include/mysql

/usr/local/mysql

/usr/bin/mysql

/var/run/mysqld

here is my command:

  ./configure --with-apxs2=/usr/sbin/apxs \
        --with-mysql=/usr/bin/mysql \
        --with-zlib --enable-mbstring \
        --with-curl

i assume the header files are .h files right? There are alot of those in the /usr/include/mysql but i tried that, same thing.

should i try /var/lib64 instead of lib?

Can anyone please tell me where to find the header files and maybe even give me a sample header file name so i can do a locate on that one name to see if it exists? If so then that will help me find the others.

Or can anyone see what im doing wrong that knows now to do this?

Thanks so much.

To get things simple, download the "bundle" from the MySQL download page under the Generally Available (GA) Releases. For example for RedHat/CentOS it's : mysql-5.7.18-1.el7.x86_64.rpm-bundle.tar

Untar this file.

If you only need the MySQL support because the database is installed on another server, install the devel rpm

rpm -Uvh mysql-community-devel-5.7.18-1.el7.x86_64.rpm

The header files are now in their default location : /usr/include/mysql/ and you can find there mysql.h

You just need to configure PHP with the default location, for example :

./configure --prefix=/tmp/php --with-mysql --with-mysqli --with-pdo-mysql

After running make and make install, run a php -i and you will the support for these 3 mysql connections.

If you also want to run a database on your server, you need to install other rpms coming with the bundle. But that was not your question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM