账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    Mac源码编译php7报iconv错误。
    63
    0
    ./configure  --prefix=/usr/local/php/7.2.7 --localstatedir=/usr/local/var --sysconfdir=/usr/local/etc/php/7.2.7 --with-config-file-path=/usr/local/etc/php/7.2.7 --with-config-file-scan-dir=/usr/local/etc/php/7.2.7/conf.d --enable-bcmath --enable-calendar --enable-dba --enable-dtrace --enable-exif --enable-ftp --enable-fpm --enable-intl --enable-mbregex --enable-mbstring --enable-mysqlnd --enable-shmop --enable-soap --enable-sockets --enable-zip --with-bz2 --with-fpm-user=_www --with-fpm-group=_www --with-freetype-dir=/usr/local/Cellar/freetype/2.9 --with-gd --with-gettext=/usr/local/Cellar/gettext/0.19.8.1 --with-imap-ssl=/usr/local/Cellar/openssl/1.0.2n --with-jpeg-dir=/usr/local/Cellar/jpeg/9c --with-ldap --with-libzip --with-mhash --with-mysql-sock=/tmp/mysql.sock --with-mysqli=mysqlnd --with-ndbm --with-openssl=/usr/local/Cellar/openssl/1.0.2n --with-pic --with-png-dir=/usr/local/Cellar/libpng/1.6.34  --with-sodium=/usr/local/Cellar/libsodium/1.0.16 --with-tidy  --with-xmlrpc --with-xsl --with-zlib --with-curl --enable-debug --with-pdo --with-pdo-mysql --with-iconv=/usr/local/Cellar/libiconv/1.15

    编译命令已经指定了iconv的库的目录,而且这个库是通过brew install libiconv安装的。但是执行./configure 命令时还一直提示:

    configure: error: Please reinstall the iconv library.

    感觉很无奈。

    1
    打赏
    收藏
    点击回答
        全部回答
    • 0
    • ┃僅此邇魢ヽ 普通会员 1楼

      iconv()函数是一个C语言的函数,用于在不同的编码系统之间进行转换。在Mac OS上,iconv()函数默认在系统环境变量中打开。

      然而,当你尝试编译PHP7时,如果存在PHP的环境变量,但是它没有打开,那么iconv()函数可能无法正常工作。

      以下是一些可能的解决方案:

      1. 首先,确保你的PHP环境变量已经打开。你可以通过在终端中输入以下命令来检查:

      echo PHP发售版本号

      如果你看到"PHP 7.1"或更高版本,那么你的PHP环境变量应该是打开的。

      1. 如果你的PHP环境变量仍然是打开的,但iconv()函数仍然报错,那么你可能需要添加PHP的环境变量到你的PATH环境变量中。你可以通过在终端中输入以下命令来完成:

      export PATH=$PATH:/usr/bin/php7.1

      这将把PHP的bin目录添加到你的PATH环境变量中,这样你就可以通过命令行来运行PHP。

      1. 如果以上方法都无法解决问题,那么你可能需要联系PHP的开发者或技术支持团队,以获取更具体的帮助。
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部