laravel中用到ldap认证包,要求php7.0以上版本,而且安装Mews\Captcha包的时候 验证码无法显示

报错如下:

Call to undefined function Intervention\Image\Gd\imagettfbbox()

搜索发现需要重新编译php,添加 --with-jpeg-dir=DIR

1.下载源码  http://mirrors.sohu.com/php

wget -c http://mirrors.sohu.com/php/php-7.1.7.tar.gz

tar -zxvf php-7.1.7.tar.gz

cd php-7.1.7
./configure --prefix=/usr/local/php7.1.7 \
--with-config-file-path=/usr/local/php7.1.7/etc \
--with-config-file-scan-dir=/usr/local/php7.1.7/etc/conf.d \
--with-apxs2=/usr/local/bin/apxs \
--enable-fpm \
--with-fpm-user=www \
--with-fpm-group=www \
--with-mysqli \
--with-pdo-mysql \
--with-iconv-dir \
--with-freetype-dir \
--with-zlib \
--with-jpeg-dir \
--with-png-dir \
--with-libxml-dir=/usr/bin/xml2-config \
--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=/usr/local/Cellar/openssl/1.0.2o_1 \
--with-mhash \
--enable-pcntl \

--with-ldap \
--enable-sockets \

编译的过程遇到的问题

1.apxs报错的问题
Sorry, I cannot run apxs. Possible reasons follow: . Perl is not installed
. apxs was not found. Try to pass the path using --with-apxs2=/path/to/apxs
. Apache was not built using --enable-so (the apxs usage page is displayed) 解决办法
brew install httpd,然后
find / -name apxs
Centos下执行 yum install -y httpd-devel 查找到apxs文件路径,然后修改编译参数如下
--with-apxs2=/usr/local/bin/apxs
.configure: error: OpenSSL version 1.0. or greater required.

解决办法:
brew upgrade openssl
然后修改编译参数为 openssl的实际路径 --with-openssl=/usr/local/Cellar/openssl/1.0.2o_1
上述路径根据自己的环境灵活修改
Centos下 需要 yum install openssl openssl-devel
然后ln -s /usr/lib64/lib
configure: error: Cannot find ldap libraries in /usr/lib
解决办法:
cp -frp /usr/lib64/libldap* /usr/lib/
然后再./configure ...即可
报错信息
/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_scanf'
/usr/lib64/liblber-2.4.so.: error adding symbols: DSO missing from command line
collect2: error: ld returned exit status
make: *** [sapi/cli/php] 错误 解决办法: ./configure后
编辑MakeFile
找到 开头是 'EXTRA_LIBS' 这一行 在结尾加上 '-llber' 然后执行 make && make install

参考地址:

https://www.jianshu.com/p/dff29b4566a6

Mac OSX编译安装php7.1.8的更多相关文章

  1. Mac OSX编译安装php5.6

    安装好OSX 10.13以后默认自带的php7.1.7,跟现有环境不兼容,所以准备编译安装php5.6,自带的php7不建议卸载,重新安装一份php5.6 1.安装php的一些依赖,推荐使用brew安 ...

  2. Mac Pro 编译安装 Redis 的 PHP 客户端 phpredis

    1.去官网下载 redis 扩展源码包 https://github.com/phpredis/phpredis 2.安装 redis 扩展 /usr/local/src/mac-sdk/source ...

  3. 编译安装PHP7并安装Redis扩展Swoole扩展

    编译安装PHP7并安装Redis扩展Swoole扩展 在编译php7的机器上已经有编译安装过php5.3以上的版本,从而依赖库都有了 本php7是编译成fpm-php 使用的, 如果是apache那么 ...

  4. 【安装PHP】如何在openSUSE42.1下编译安装PHP7

    首先推荐一篇文章PHP 7 Release Date Arrived: Will Developers Adopt PHP 7? - PHP Classes blog. 里面说到是否会去使用PHP7, ...

  5. Mac Pro 编译安装 Redis-3.2.3

    Redis官方下载地址:http://redis.io/download Redis安装 cd /usr/local/src/redis-3.2.3 sudo make sudo make insta ...

  6. 全志a20安卓电视盒子安装可道云kodexplorer服务-编译安装php7.3+nginx

    可道云真的很强大,安装包很小,功能却很齐全,还可以自定义轻应用如果有手机客户端就更好了 研究了一下,可道云根目录放到外置存储设备(移动硬盘)会更合适,改路径的方法下面有提到上传文件时一个文件会在用户目 ...

  7. centos7.6编译安装php7.2.11及redis/memcached/rabbitmq/openssl/curl等常见扩展

    centos7.6编译安装php7..11及redis/memcached/rabbitmq/openssl/curl等常见扩展 获取Php的编译参数方法: [root@eus-api-cms-bac ...

  8. 在Mac OSX下安装Microsoft Calibri字体

    参考: Where can I find default Microsoft fonts Calibri, Cambria? 在Mac OSX下安装Microsoft Calibri字体 1.下载: ...

  9. centos7下编译安装php-7.0.15(PHP-FPM)

    centos7下编译安装php-7.0.15(PHP-FPM) 一.下载php7源码包 http://php.net/downloads.php 如:php-7.0.15.tar.gz 二.安装所需依 ...

随机推荐

  1. DELPHI 通用的数据记录复制过程

    //表名,关键字段名,单条内容的SQL语句,产生新记录的值 function Tfrmdmmain.CopyTbale(const tablename, fileldname, swhere, new ...

  2. iOS去除数组中重复的model数据

    // 去除数组中model重复 ; i < self.selectedModelArray.count; i++) { ;j < self.selectedModelArray.count ...

  3. java:shiro(认证,赋予角色,授权...)

    1.shiro(权限框架(认证,赋予角色,授权...)): readme.txt(运行机制): 1.从jsp的form中的action属性跳转到springmvc的Handler中(controlle ...

  4. C++类中的一些细节(重载、重写、覆盖、隐藏,构造函数、析构函数、拷贝构造函数、赋值函数在继承时的一些问题)

    1 函数的重载.重写(重定义).函数覆盖及隐藏 其实函数重载与函数重写.函数覆盖和函数隐藏不是一个层面上的概念.前者是同一个类内,或者同一个函数作用域内,同名不同参数列表的函数之间的关系.而后三者是基 ...

  5. Excel随机数相关

    基本函数 RAND() 函数:自动生成一个[0,1)的平均分布随机数(依重新计算而改变) RANDBETWEEN(bottom,top) :返回一个介于指定数字直接的随机数,不会自动改变 INT(nu ...

  6. idea修改java编译版本

    file--Settings project strustructure project strustructure

  7. jQuery I

    jQuery 两大特点: 链式编程:比如.show()和.html()可以连写成.show().html(). 隐式迭代:隐式对应的是显式.隐式迭代的意思是:在方法的内部进行循环遍历,而不用我们自己再 ...

  8. script学习,如何用linux监控你的同事?

    环境:CentOS7 一.为什么要学习script命令 当你在终端或控制台上工作时,你想记录下自己做了些什么吗?当你跟一些Linux管理员同时在系统上干活,你想知道别人干了什么吗?当你让别人远程到你的 ...

  9. Leetcode之动态规划(DP)专题-392. 判断子序列(Is Subsequence)

    Leetcode之动态规划(DP)专题-392. 判断子序列(Is Subsequence) 给定字符串 s 和 t ,判断 s 是否为 t 的子序列. 你可以认为 s 和 t 中仅包含英文小写字母. ...

  10. 关于js查找和筛选和循环的几种方式

    find(); find() 方法返回通过测试(函数内判断)的数组的第一个元素的值. find() 方法为数组中的每个元素都调用一次函数执行: 当数组中的元素在测试条件时返回 true 时, find ...