在 MACBOOK 上从源码编译 PHP

在 MACBOOK 上从源码编译 PHP

  1. 先从PHP官网下载源码

  2. 解压 tar -xzf php-x.x.x.tar.gz

  3. 进入php目录 cd php-x.x.x

  4. 执行 (这里根据自己的情况设置相对应的路径)

    ./configure --prefix=(需要编译的目录下) --with-config-file-path=(需要编译的目录下)/etc --enable-mysqlnd --with-mysqli --with-pdo-mysql --enable-fpm --with-zlib --enable-xml --with-openssl=/usr/local/Cellar/openssl/1.0.2p --enable-pcntl --enable-sockets --enable-session --with-curl --enable-opcache --with-zlib-dir=/usr/local/Cellar/zlib/1.2.11 --with-iconv=/usr/local/Cellar/libiconv/1.16
    
  5. 执行 make

    执行make会遇到问问题

  6. 执行 make install

posted @ 2020-01-15 16:13  pandaLIU  阅读(360)  评论(0)    收藏  举报