php7.1 编译参数,TODO:macOS编译PHP7.1

原标题:TODO:macOS编译PHP7.1

TODO:macOS编译PHP7.1

06aa7a5d2375db3e29e977dc2916ec7c.png

本文主要介绍在macOS上编译PHP7.1,有兴趣的朋友可以去尝试一下。

1.下载PHP7.1源码,建议到PHP官网下载纯净到源码包php-7.1.0.tar.gz

2.解压php-7.1.0.tar.gz包

3.创建配置

./configure --prefix=/usr/local/php7 --with-apxs=/usr/sbin/apxs --enable-fpm --with-fpm-user=www --with-fpm-group=www --with-mysqli --with-pdo-mysql --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --enable-ftp --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --without-pear --with-gettext --disable-fileinfo --enable-maintainer-zts

4.编译代码

make

335a4338e940f26121d260e65f1a3dd6.png

make test

01e245133269aaed47a406dcdc9b45f8.png

5.安装php

make install

a94f32d71b195d2fd630ab241562fa31.png

6.顺利的花这样就把php7.1编译好了,把php7对应的执行文件拷贝到/usr/bin/ 即可在终端使用了

sudo cp /usr/local/php7/bin/ph* /usr/bin/

0e111ff72f746237d3f8024d05c6554f.png

92bc8cd018bcbd50c945d24cc8a911ab.png

7.编译步骤是很简单,但是编译过程难免会遇到一些问题,以下是小编遇到的问题总结

8.安装autoconf

9f716d3bf955d3a4c5b6f15704c35b05.png

9.openssl版本问题

configure: error: OpenSSL version 1.0.1 or greater required.

eb81802ccb2e944a42e2f45b1ebbfb2e.png

b2f4f89b5e38c865fcec563ec3542a03.png

安装更高版本的openssl或者下载openssl源码来编译,简单的方法就是使用brew来安装

5c237bbd2307b8be979446b7b2458b1a.png

10.Cannot find libz,这个需要安装xcode-select,在终端输入xcode-select --install

029f0d7714d8d0ca63c9fd2ccfe196d3.png

1e9535297de0fa03a00d6ecfaf09dcbd.png

9e10d6618a377e53a73f83d1902dc1af.png

11.Cannot locate header file libintl.h

1f221a1136169f65409ad758065719c3.png

安装gettext

117087e514828ae5a7d04cb296597ce3.png

编辑php源码configure文件

5adfdbbf4b353749be6ca4d67167d541.png

改成

1e5c880d7edf9446bc92840809d415af.png

12.mcrypt.h not found. Please reinstall libmcrypt.

8af395943c2232ecfd6dffd85d70d9f8.png

安装libmcrypt

f48bab9047e07297729698433d5ff3d1.png

13. 基本就是遇到这些情况了,还有一种使用php7的方法就是安装MAMP,是商业软件存在试用期限制,可以把安装好的php7文件取出来使用,小编试过,可以正常使用。返回搜狐,查看更多

责任编辑:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
填充下面这个程序中所有出现// TODO: fill the code这个任务的地方#include <iostream> #include <cstring> #include "ourstring.h" #include "strlib.h" using namespace std; OurString::OurString(){ // TODO: fill the code } OurString::OurString(const char *str){ // TODO: fill the code } OurString::OurString(const OurString &dstr){ // TODO: fill the code } OurString::~OurString(){ // TODO: fill the code } string OurString::toString() const{ // TODO: fill the code } OurString OurString::subStr(unsigned int start, unsigned int n) const{ // TODO: fill the code } bool OurString::operator > (const OurString &dstr) const{ // TODO: fill the code } bool OurString::operator < (const OurString &dstr) const{ // TODO: fill the code } bool OurString::operator == (const OurString &dstr) const{ // TODO: fill the code } unsigned int OurString::length () const{ // TODO: fill the code } const OurString& OurString::operator = (const OurString &dstr){ // TODO: fill the code } const OurString& OurString::operator = (const char *str){ // TODO: fill the code } char& OurString::operator[](int index){ // TODO: fill the code } const OurString OurString::operator + (const OurString &dstr) const{ // TODO: fill the code } const OurString OurString::operator + (const char *str) const{ // TODO: fill the code } const OurString& OurString::operator += (const OurString &dstr){ // TODO: fill the code } const OurString& OurString::operator += (const char *str){ // TODO: fill the code } ostream & operator<<(ostream &os, const OurString &dstr){ // TODO: fill the code } istream & operator>>(istream &is, OurString &dstr){ // TODO: fill the code }
最新发布
05-29
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值