Mac上的PDO MySQL驱动程序 [英] PDO MySQL Driver on Mac

查看:345
本文介绍了Mac上的PDO MySQL驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一台安装了大约一年前的自定义PHP 5的Mac.我记得整个星期天都花了,所以我不得不编译大约20次才能正确处理.我拥有的MySQL来自熵,并且已经过预编译.

I have a mac with a custom PHP 5 install that built from about a year ago. I remember it took all Sunday and I had to compile about 20 times to get it right. The MySQL I have is from entropy and was precompiled.

现在,我需要在MySQL驱动程序正常工作的情况下获得PDO,并且尚未安装该驱动程序.我尝试了"pecl install pdo_mysql",它死于找不到某些mysql文件的位置.有什么想法可以快速解决吗?

Now I need to get PDO with the MySQL driver working and the driver is not installed. I tried the "pecl install pdo_mysql" and it dies at a point where it can't find some mysql files. Any ideas how I can fix this quickly?

checking for mysql_config... not found
configure: error: Cannot find MySQL header files under
ERROR: `/private/tmp/pear/temp/PDO_MYSQL/configure' failed

我将发布您需要帮助解决此问题的所有路径或消息.我将不得不重新编译PHP,还是可以仅编译pdo_mysql扩展?

I'll post whatever paths or messages you need to help me troubleshoot this. Will I have to compile PHP all over again, or can I just compile the pdo_mysql extension?

我希望我不会显得懒惰,我只需要编写很多代码,而不必花很多时间来应对我的PHP配置.

I hope I don't seem lazy, I just have a lot of code to write and not a lot of time to fight with my PHP configuration.

推荐答案

您将需要手动进行编译,而不是通过PECL进行编译.您需要知道MySQL的安装位置.我不了解Entropy软件包,但是MySQL提供的构建(我推荐)安装在/usr/local/mysql中.

You're going to need to compile it by hand, instead of via PECL. You'll need to know where your MySQL install is. I don’t know about the Entropy packages, but the builds provided by MySQL (which I recommend) install into /usr/local/mysql.

$ pecl download pdo_mysql
$ tar xzf PDO_MYSQL-1.0.2.tgz
$ cd PDO_MYSQL-1.0.2
$ phpize
$ ./configure --with-pdo-mysql=/usr/local/mysql
$ make && sudo make install

这应该使您可以进行配置.

And that should get you to the point where you can configure it.

这篇关于Mac上的PDO MySQL驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆