<checking for mysql_config not found>

php 5.3.29编译安装排错:

 

 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-pdo-mysql=/usr/loca/mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-vpx-dir=/usr/local/libvpx/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session  --with-curl --enable-ctype

 

错误:

 

    1. checking for mysql_config... not found
    2. configureerror: Unable to find your mysql installation

 

我找了很多方法,但都没解决:

1、这种很接近,但不明确,还是让人蒙圈。

这个由于在编译的时候指定了 ‘ --with-pdo-mysql ’ 选项,但它并没有找到 mysql 的安装目录,因此只用指定 mysql 的安装目录就可以了  '--with-pdo-mysql=/usr/local/mysql'

2、这种完全不沾边,错误的。

1)sudo ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config
将mysql_confi从你的安装目录链接到/usr/local/bin目录下,这样就可以在任意目录下访问了(也可以放到/usr/bin)
      2)编辑源码文件夹的site.cfg文件,去掉#mysql_config = /usr/local/bin/mysql_config前的注释#,修改后面的路径为你的mysql_config真正的目录就可以了。(如果不知道mysql_config在哪里,运行命令:whereis mysql_config)

3、和第二种一样的想法,也是错误的。

 

执行

 

ln -s /usr/local/mysql/bin/mysql_config /usr/local/bin/mysql_config

 

将mysql_config链接到/usr/local/bin目录下

4、我感觉有点可能。

yum install mysl   mysql-devel 

5、有一篇说背人的博客写的都是错的,安装这2个包就可以解决,他自己试过,但是没解决我的问题。

 

MySQL-shared-compat-5.5.40-1.el6.x86_64.rpm

MySQL-shared-5.5.40-1.el6.x86_64.rpm

mysql-embedded-devel-5.1.73-3.el6_5.x86_64

 

下面来说下我的最简单,直接有效的办法:

 ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/bin/mysql_config --with-pdo-mysql --with-gd --with-png-dir=/usr/local/libpng --with-jpeg-dir=/usr/local/jpeg --with-freetype-dir=/usr/local/freetype --with-vpx-dir=/usr/local/libvpx/ --with-zlib-dir=/usr/local/zlib --with-t1lib=/usr/local/t1lib --with-iconv --enable-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --enable-opcache --enable-mbregex --enable-fpm --enable-mbstring --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --enable-session  --with-curl --enable-ctype

 

报错是因为mysql安装这个插件时,按指定的路径找不到。我们干嘛要去干预呢,直接为空,让它自己搜索找去,这样不就好了。

posted @ 2015-01-09 11:38  Linux.应用  阅读(4528)  评论(1编辑  收藏  举报