mac 安装php-mongdb扩展

news/2024/7/4 10:03:24
  1. 安装 homebrew

  2. 确定已安装 pkg-config

$ where pkg-config
/usr/local/bin/pkg-config

若提示

pkg-config not found

则先使用 brew install pkg-config 进行安装

  1. 安装最新的 OpenSSL

macOS 默认的 OpenSSL 版本太低,编译时需要版本高于1.0.1才可,so just install the lastest one.

$ brew install openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2l.sierra.bottle.tar.gz
Already downloaded: /Users/mrasong/Library/Caches/Homebrew/openssl-1.0.2l.sierra.bottle.tar.gz
==> Pouring openssl-1.0.2l.sierra.bottle.tar.gz
==> Using the sandbox
==> Caveats
A CA file has been bootstrapped using certificates from the SystemRoots
keychain. To add additional certificates (e.g. the certificates added in
the System keychain), place .pem files in
  /usr/local/etc/openssl/certs

and run
  /usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local,
because Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/openssl/lib/pkgconfig

==> Summary
  /usr/local/Cellar/openssl/1.0.2l: 1,709 files, 12.2MB

安装完成后,需要给环境变量里面加入一些东西,上面的提示已经说的很清楚。

vi ~/.zshrc 或者 vi ~/.bash_profile

添加以下内容

export PATH=/usr/local/opt/openssl/bin:$PATH
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"

source ~/.zshrc 或者 source ~/.bash_profile

  1. pecl 安装 mongodb.so
pecl install mongodb
  1. 修改 php.ini,加入 extension=mongodb.so,重启服务,完成。

 

 


http://www.niftyadmin.cn/n/2124334.html

相关文章

Solaris修改主机名和ip

目的: 主机名称:cjh1 , IP地址:192.168.1.2 , 子网掩码:255.255.255.0, 默认路由:192.168.1.1。 我们准备把它修改为: 主机名称:suncjh &#xf…

greenplum 5.7 + gpcheck

gpcheck 查看帮助 [gpadminnode1 bin]$ gpcheck --help COMMAND NAME: gpcheckVerifies and validates Greenplum Database platform settings.***************************************************** SYNOPSIS *****************************************************gpche…

CentOS7下安装JDK1.8详细过程

3. 解压安装JDK 键入命令 cd /usr 来到刚才的复制文件处,键入命令tar -zxvf java1.8 进行解压 解压效果如下 4. 配置JDK环境变量 键入命令 vim /etc/profile 修改配置文件,记得要在root权限下修改 输入i进入编辑状态,然后将光标移到最后一…

greenplum 5.7 + gpcheckcat

gpcheckcat 查看帮助 $ gpcheckcat -?Usage: gpcheckcat [<option>] [dbname]-?-B parallel: number of worker threads-g dir : generate SQL to rectify catalog corruption, put it in dir-p port : DB port number-P passwd : DB password-U uname : D…

数据库,Unix

Solaris安装Oracle需要安装的包是&#xff1a;SUNWi1cs&#xff0c; SUNWi15cs进入到/cdrom/solaris,.../Sorl./Product下 pkgadd -d . SUNWi1cs 内核参数&#xff1a; set shmsys:shminfo_shmmax4294967295set shmsys:shminfo_shmmni100set semsys:seminfo_semmni100set sem…

CentOS 7安装Elasticsearch 7.2

一 安装jdk elasticsearch7.2 要求JDK版本是jdk11 &#xff0c;我一不小心装JDK8,最后发现不装JDK也可以 。 elasticsearch7.2中包含JDK,只要做一些配置就可以 。详见下边 三 二、Elasticsearch安装配置 &#xff08;1&#xff09;Elasticsearch安装 Elasticsearch的下载…

iSCSI配置

openfiler的配置1&#xff0c;用户名是&#xff1a;openfiler 密码是&#xff1a;password 2&#xff0c;将openfiler用作iSCSI存储服务器&#xff0c;我们需要执行六个主要的任务&#xff1a;设置iSCSI的服务&#xff0c;配置网络访问&#xff0c;制定物理存储并对其分区&am…

fdw postgres_fdw

os:centos 6.8 db:postgresql 9.6 fdw&#xff1a;foreign data wrapper&#xff0c;postgresql的外部数据包装器。 postgres_fdw 是用于postgresql的数据库之间连接&#xff0c;原因是postgresql不能直接跨库访问&#xff0c;被设计用来替代dblink。 这么口语化的描述&#x…