【问题标题】:"mysql_config not found" when trying to install PHP 7.2 from sources尝试从源安装 PHP 7.2 时出现“mysql_config not found”
【发布时间】:2019-08-20 18:47:29
【问题描述】:

在 Ubuntu 上,我目前从 Apache 2.2.32 + PHP 5.4.45 + mySQL 5.1.55 源安装。现在,我想安装 PHP 7.2.16。

我下载了 .tar.gz 文件,并尝试对 PHP 进行“配置”:

sudo ./configure --prefix=/usr/local/php_7.2.16 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql --with-gettext --with-curl

(显然,它与 PHP 5.4 一起使用,与另一个目录一起使用)

但是,我现在收到以下错误消息:

mysql_config not found
configure: error: Please reinstall the mysql distribution

我必须从头开始重新安装 mySQL,还是有任何解决方法可以避免这种情况?谢谢。

【问题讨论】:

  • 我已经阅读了手册(php.net/manual/en/mysqli.installation.php),发现我必须指出'mysql_config'的路径。我试过:sudo ./configure --prefix=/usr/local/php_7.2.16 --with-apxs2=/usr/local/apache2/bin/apxs --with-mysqli=/usr/local/mysql-5.1。 55/bin/mysql_config --with-gettext --with-curl 成功了

标签: php mysql ubuntu installation lamp


【解决方案1】:

mysql_config 是通过 mysql-devel 安装的。如果你运行 mysql_config 它应该返回给你编译客户端的所有选项。如果你从包中安装它,它应该在 /usr/bin/mysql_config 之类的地方。 并且源码编译php的时候可以传下mysql_config的路径

--with-mysqli=/usr/bin/mysql_config

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-27
    • 2011-07-07
    • 1970-01-01
    • 2017-10-19
    • 2018-05-31
    • 2014-10-17
    相关资源
    最近更新 更多