20110924

PDO_MYSQL checking for mysql_config... not found

如果你在編 PDO_MYSQL 的時候遇到下列訊息,

checking for mysql_config... not found
configure: error: Cannot find MySQL header files under

這個時候你可能採到跟我一樣的地雷, 我 google 了 'checking for mysql_config... not found' 這個錯誤訊息, 找到這個標題
install PDO_MYSQL - mysql_config and header files problem

我心裡的OS, 不會吧, 真的這麼賽??? 結果我照著作之後問題就解決了... 所以這邊我找到甚麼問題呢???
他媽媽的小朋友 mysql_config... not found 這個檢查是 hardcode, 根本不會跟後面的 --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql 參數找 mysql_config 這個檔案...

他媽媽的小朋友 bug, 我被這個東西困住整整一年呀...


cd ../PDO_MYSQL-1.0.2
./configure --with-php-config=/usr/local/php/bin/php-config --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql
......
checking for PHP prefix... /usr/local/php
checking for PHP includes... -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php/lib/php/extensions/no-debug-zts-20060613
checking for PHP installed headers prefix... /usr/local/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.13.5 (ok)
checking for gawk... gawk
checking for MySQL support for PDO... yes, shared
checking for mysql_config... not found
configure: error: Cannot find MySQL header files under


checking for mysql_config... not found
configure: error: Cannot find MySQL header files under

google search 'checking for mysql_config... not found'

I found this title!!!
install PDO_MYSQL - mysql_config and header files problem

If you trace the fatal error, it's due to the PDO configure script being unable to find the MySQL header. Go up one step further and the configure reports that it can't find mysql_config.

The lines below show that mysql_config is actually installed. To make matters even clearer, php was compiled with the option '--with-mysql=/usr/local/mysql/', but it seems the pecl installer doesn't think about that.

chris@snackerjack-lx:/usr/src$ locate mysql_config
/usr/local/mysql/bin/mysql_config
/usr/local/mysql/man/man1/mysql_config.1

The way I was able to fix this issue was simply by providing a symbolic link from the binary to /usr/bin/mysql_config

chris@snackerjack-lx:/usr/src$ sudo ln -s /usr/local/mysql//bin/mysql_config /usr/bin/mysql_config

The extension then compiles without problem!


What The Fuck mysql_config checker is hardcode !!!

2 則留言:

凍仁 提到...

辛苦了,手編的苦主...

DAVID LI-FU HUANG 提到...

The way I was able to fix this issue was simply by providing a symbolic link from the binary to /usr/bin/mysql_config

chris@snackerjack-lx:/usr/src$ sudo ln -s /usr/local/mysql//bin/mysql_config /usr/bin/mysql_config

The extension then compiles without problem!

這是最簡單的解決方式, 建立一個符號鏈結就可以了