Fix cannot find MySQL header files Under/usr/include/mysql error

Source: Internet
Author: User
Tags fpm soap mcrypt mysql client openssl sapi zts

Follow the steps below to achieve a successful, pro-Test. Reprint, take notes.

Compiled php-5.5-6 MySQL support, appeared cannot find MySQL header files Under/usr/include/mysql. Note that the MySQL client library isn't bundled anymore! error! Here's how to fix it:

[Email protected] php-5.5.6]#/configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc-- With-mysql=/usr/include/mysql--with-mysqli=/usr/bin/mysql_config--with-iconv-dir--with-freetype-dir=/data/apps /libs--with-jpeg-dir=/data/apps/libs--with-png-dir=/data/apps/libs--with-zlib--with-libxml-dir=/usr-- Enable-xml--disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl- -enable-mbregex--enable-fpm--enable-mbstring--with-mcrypt=/data/apps/libs--with-gd--enable-gd-native-ttf-- With-openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--enable-opcache-- With-pdo-mysql--enable-maintainer-zts

Checking for string.h ... (cached) Yes
Checking for strings.h ... (cached) Yes
Checking for unistd.h ... (cached) Yes
Checking for sys/time.h ... (cached) Yes
Checking sys/times.h usability ... yes
Checking Sys/times.h presence ... yes
Checking for sys/times.h ... yes
Checking for stdarg.h ... (cached) Yes
Checking size of int ... (cached) 4
Checking size of short ... (cached) 2
Checking size of long ... (cached) 4
Checking for an ANSI c-conforming const ... Yes
Checking whether Time.h and sys/time.h may both be included ... yes
Checking for working alloca.h ... (cached) Yes
Checking for alloca ... (cached) Yes
Checking for working memcmp ... yes
Checking for stdarg.h ... (cached) Yes
Checking for MCrypt support ... yes
Checking for Libmcrypt version ... >= 2.5.6
Checking for Mcrypt_module_open in-lmcrypt ... yes
Checking for MSSQL support via FreeTDS ... no
Checking for MySQL support ... yes
Checking for specified location of the MySQL UNIX socket ... no
Configure:error:Cannot find MySQL header files Under/usr/bin/mysql.
Note that the MySQL client library isn't bundled anymore!
[Email protected] php-5.5.6]# Find/-name mysql.h
/usr/include/mysql/mysql.h

To find the Mysql.h file, we change the parameter to--WITH-MYSQL=/USR, if not, install the Mysql-devel package,

[email protected] php-5.5.6]# Yum install Mysql-devel

Re-run the compile command

[Email protected] php-5.5.6]#/configure--prefix=/usr/local/php--with-config-file-path=/usr/local/php/etc-- WITH-MYSQL=/USR--with-mysqli=/usr/bin/mysql_config--with-iconv-dir--with-freetype-dir=/data/apps/libs-- With-jpeg-dir=/data/apps/libs--with-png-dir=/data/apps/libs--with-zlib--with-libxml-dir=/usr--enable-xml-- Disable-rpath--enable-bcmath--enable-shmop--enable-sysvsem--enable-inline-optimization--with-curl-- Enable-mbregex--enable-fpm--enable-mbstring--with-mcrypt=/data/apps/libs--with-gd--enable-gd-native-ttf-- With-openssl--with-mhash--enable-pcntl--enable-sockets--with-xmlrpc--enable-zip--enable-soap--enable-opcache-- With-pdo-mysql--enable-maintainer-zts

The compilation process is omitted
......
Generating files
Configure:creating./config.status
Creating MAIN/INTERNAL_FUNCTIONS.C
Creating MAIN/INTERNAL_FUNCTIONS_CLI.C
+--------------------------------------------------------------------+
| License: |
| This software was subject to the PHP License, available in this |
| Distribution in the file LICENSE. By continuing this installation |
| Process, you is bound by the terms of this License agreement. |
| If you don't agree with the terms of this license, you must abort |
| The installation process at this point. |
+--------------------------------------------------------------------+

Thank for using PHP.

Config.status:creating Php5.spec
Config.status:creating Main/build-defs.h
Config.status:creating scripts/phpize
Config.status:creating scripts/man1/phpize.1
Config.status:creating Scripts/php-config
Config.status:creating Scripts/man1/php-config.1
Config.status:creating SAPI/CLI/PHP.1
Config.status:creating sapi/fpm/php-fpm.conf
Config.status:creating SAPI/FPM/INIT.D.PHP-FPM
Config.status:creating Sapi/fpm/php-fpm.service
Config.status:creating sapi/fpm/php-fpm.8
Config.status:creating sapi/fpm/status.html
Config.status:creating SAPI/CGI/PHP-CGI.1
Config.status:creating Ext/phar/phar.1
Config.status:creating Ext/phar/phar.phar.1
Config.status:creating main/php_config.h
config.status:executing default Commands

Success! Compile and pass!

Fix cannot find MySQL header files Under/usr/include/mysql error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.