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

最新文章

  1. Leetcode 110. Balanced Binary Tree
  2. 记一次IIS Express 之经典模式与集成模式切换
  3. [转]Python零碎知识(2):强大的zip
  4. 关于window.onload,window.onbeforeload与window.onunload
  5. EDdb 是ED数据
  6. 动画的button(按下时缩小,松开时恢复)
  7. Codeforce Round #221 Div2
  8. JS原生回到顶部效果
  9. BZOJ 1047 理想的正方形
  10. JavaWeb学习记录(十五)——浏览器Cookie禁用后的处理
  11. ajax方法完整的事件流
  12. 不用删除整个Maven本地库文件夹,Eclipse下直接更新Maven库
  13. Asp.net最基本的文件上传功能代码
  14. 609C Load Balancing
  15. [poj解题]1017
  16. Ajax.BeginForm()知多少
  17. 详解go语言的array和slice 【一】
  18. Error filterStart的问题
  19. LoRaWAN 1.1 网络协议规范 - 5 MAC指令
  20. EasyNetQ介绍

热门文章

  1. 阶段3 3.SpringMVC·_06.异常处理及拦截器_5 SpringMVC拦截器之编写controller
  2. CDH spark 命令行测试
  3. windows客户端如果通过cmd窗口连接到远程linux服务器,可以使用telnet;
  4. subquery 子查询
  5. 小菜鸟之java内存结构
  6. python list pop()方法
  7. 尝试自己搭一个简单的typescript运行环境
  8. jQuery导出word文档
  9. Ansible 清单与命令解析
  10. 最新省市区地区数据sql版本(2019年1月)