源码安装zabbix3.2.7时PHP ldap Warning

问题如下:

解决方法:

1、首先查看源码安装的php模块中是否有ldap.so

[[email protected] ldap]# ll  /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/total 1576-rwxr-xr-x 1 root root  129484 Aug 22 10:18 ldap.so               # 出现告警是因为此模块不存在,须要编译生成此模块并重新加载-rwxr-xr-x 1 root root 1430846 Aug 21 19:38 opcache.so[[email protected] ldap]# 

2、如何本机中已经有ldap.so,只须要在php.ini文件中添加extension=ldap.so

    864 ; Dynamic Extensions ;
    865 ;;;;;;;;;;;;;;;;;;;;;;
    866
    867 ; If you wish to have an extension loaded automatically, use the following
    868 ; syntax:
    869     extension=ldap.so          #新添加内容
    870 ;
    871 ;   extension=modulename.extension
    872 ;
    873 ; For example, on Windows:
    874 ;
    875 ;   extension=msql.dll
    876 ;
    877 ; ... or under UNIX:
    878 ;
    879 ;   extension=msql.so
    880 ;
    881 ; ... or with a path:
    882 ;
    883 ;   extension=/path/to/extension/msql.so
    884 ; 

3、如果相应的模块不存在

  3.1下载相应的php版本源码到主目录,进行源码编译ldap模块(重点,其他模块如果缺失编译方法一样)

[[email protected] ~]# tar jxvf php-7.1.7.tar.bz2
[[email protected] ~]# ls
anaconda-ks.cfg                  install.log         lnmp-install.log  php-7.1.7.tar.bz2
databases_backup_20170821115223  install.log.syslog  php-7.1.7
[[email protected] ldap]# cd /root/php-7.1.7/ext/ldap/            #进入模块所在的源码位置[[email protected] ldap]# lltotal 144-rw-rw-r-- 1 1000 1000   7374 Jul  6 17:30 config.m4-rw-rw-r-- 1 1000 1000   1008 Jul  6 17:30 config.w32-rw-rw-r-- 1 1000 1000     77 Jul  6 17:30 CREDITS-rw-rw-r-- 1 1000 1000 102189 Jul  6 17:30 ldap.c-rw-rw-r-- 1 1000 1000   4464 Jul  6 17:30 ldap.mak-rw-rw-r-- 1 1000 1000   1546 Jul  6 17:30 LDAP_Win32_HOWTO.txt-rw-rw-r-- 1 1000 1000   2315 Jul  6 17:30 php_ldap.hdrwxrwxr-x 2 1000 1000  12288 Jul  6 17:30 tests[[email protected] ldap]# /usr/local/php/bin/phpize             #编译PHP扩展的工具,主要是根据系统信息生成对应的configure文件   Configuring for:PHP Api Version:         20160303Zend Module Api No:      20160303Zend Extension Api No:   320160303[[email protected] ldap]# ./configure  --with-php-config=/usr/local/php/bin/php-config  --with-ldap   #编译checking for grep that handles long lines and -e... /bin/grepchecking for egrep... /bin/grep -Echecking for a sed that does not truncate output... /bin/sed........

[[email protected] ldap]# make && make install                                                #安装/bin/sh /root/php-7.1.7/ext/ldap/libtool --mode=compile cc -DLDAP_DEPRECATED=1 -I. -I/root/php-7.1.7/ext/ldap -DPHP_ATOM_INC -I/root/php-7.1.7/ext/ldap/include -I/root/php-7.1.7/ext/ldap/main -I/root/php-7.1.7/ext/ldap -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -c /root/php-7.1.7/ext/ldap/ldap.c -o ldap.lo mkdir .libs cc -DLDAP_DEPRECATED=1 -I. -I/root/php-7.1.7/ext/ldap -DPHP_ATOM_INC -I/root/php-7.1.7/ext/ldap/include -I/root/php-7.1.7/ext/ldap/main -I/root/php-7.1.7/ext/ldap -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /root/php-7.1.7/ext/ldap/ldap.c  -fPIC -DPIC -o .libs/ldap.o/bin/sh /root/php-7.1.7/ext/ldap/libtool --mode=link cc -DPHP_ATOM_INC -I/root/php-7.1.7/ext/ldap/include -I/root/php-7.1.7/ext/ldap/main -I/root/php-7.1.7/ext/ldap -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib  -DHAVE_CONFIG_H  -g -O2   -o ldap.la -export-dynamic -avoid-version -prefer-pic -module -rpath /root/php-7.1.7/ext/ldap/modules  ldap.lo -lldap -llbercc -shared  .libs/ldap.o  -lldap -llber  -Wl,-soname -Wl,ldap.so -o .libs/ldap.socreating ldap.la(cd .libs && rm -f ldap.la && ln -s ../ldap.la ldap.la)/bin/sh /root/php-7.1.7/ext/ldap/libtool --mode=install cp ./ldap.la /root/php-7.1.7/ext/ldap/modulescp ./.libs/ldap.so /root/php-7.1.7/ext/ldap/modules/ldap.socp ./.libs/ldap.lai /root/php-7.1.7/ext/ldap/modules/ldap.laPATH="$PATH:/sbin" ldconfig -n /root/php-7.1.7/ext/ldap/modules----------------------------------------------------------------------Libraries have been installed in:   /root/php-7.1.7/ext/ldap/modules

If you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify the full pathname of the library, or use the `-LLIBDIR‘flag during linking and do at least one of the following:   - add LIBDIR to the `LD_LIBRARY_PATH‘ environment variable     during execution   - add LIBDIR to the `LD_RUN_PATH‘ environment variable     during linking   - use the `-Wl,--rpath -Wl,LIBDIR‘ linker flag   - have your system administrator add LIBDIR to `/etc/ld.so.conf‘

See any operating system documentation about shared libraries formore information, such as the ld(1) and ld.so(8) manual pages.----------------------------------------------------------------------

Build complete.Don‘t forget to run ‘make test‘.

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/          #make 生成模块安装位置[[email protected] ldap]# [[email protected] php-7.1.7]# ll /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/                   #确认ldap.so模块存在total 1576-rwxr-xr-x 1 root root  129484 Aug 22 10:18 ldap.so-rwxr-xr-x 1 root root 1430846 Aug 21 19:38 opcache.so

[[email protected] php-7.1.7]# vi /usr/local/php/etc/php.ini                                         #编辑php.ini,添加新生成的ldap.so模块

    853 default_socket_timeout = 60    854     855 ; If your scripts have to deal with files from Macintosh systems,    856 ; or you are running on a Mac and need to deal with files from    857 ; unix or win32 systems, setting this flag will cause PHP to    858 ; automatically detect the EOL character in those files so that    859 ; fgets() and file() will work regardless of the source of the file.    860 ; http://php.net/auto-detect-line-endings    861 ;auto_detect_line_endings = Off    862     863 ;;;;;;;;;;;;;;;;;;;;;;    864 ; Dynamic Extensions ;    865 ;;;;;;;;;;;;;;;;;;;;;;    866     867 ; If you wish to have an extension loaded automatically, use the following    868 ; syntax:    869     extension=ldap.so                                     #新添加模块    870 ;    871 ;   extension=modulename.extension    872 ;    873 ; For example, on Windows:    874 ;    875 ;   extension=msql.dll    876 ;    877 ; ... or under UNIX:    878 ;    879 ;   extension=msql.so    880 ;

[[email protected] php-7.1.7]# service httpd restart           #重启httpd                                                      restart apache...  done

 4、http://192.168.0.198/zabbix/setup.php再次进入前端安装

  发现PHP LDAP模块 OK!!

5、至此zabbix 前面安装 “Check of pre-requisites”全部OK

时间: 2024-11-10 07:37:22

源码安装zabbix3.2.7时PHP ldap Warning的相关文章

CentOS 源码安装 zabbix3.4

环境: CentOS: 6.9 IP:192.168.1.92 JDK:1.7.0.45 ngingx: 1.13.6 mysql:  5.7.21-linux-glibc2.5-x86_64 php:    5.6.31 zabbix: 3.4.2 源码包存放路径:/data/tools/ 安装路径:      /usr/local/ 1.关闭防火墙和selinux 1.1. 关闭iptables ]# service iptables stop iptables: Setting chain

如何解决源码安装软件中make时一直重复打印configure信息

在通过源码安装软件时,会出现执行./configure后再make时总是重复打印configure的信息,无法进入下一阶段的安装. 主要原因是系统当前的时间与实际时间不一致,特别是在虚拟机上经常会出现这样的情况,可以通过date命令查看当前系统时间. 解决方法: 通过ntp更新一下时间再进行make安装:ntpdate 1.cn.pool.ntp.org (服务器地址选一个可以用的即可)

Linux MySQL源码安装缺少ncurses-devel包

在Red Hat Enterprise Linux Server release 5.7 上用源码安装MySQL-5.6.23时,遇到了" remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel."错误,如下所示 [[email protected] mysql-5.6.23]#

centos7源码安装MySQL8.0.12

MySQL官方的安装布局是:/usr/local/mysql{bin,docs,man,include,lib,share,support-files} 对于编译布尔选项,可以将值指定为1或ON启用该选项,0或OFF表示禁用该选项.许多选项配置可在服务器启动时覆盖编译时的默认值的. 1.前期准备: 卸载系统自带的mysql及配置文件和库,运行rpm -qa|grep -i mysq和rpm -qa|grep -i mariadb,使用rpm -e --nodes前两个名利筛选出来的包,再看看/e

zabbix3.4源码安装步骤

zabbix3.4源码安装步骤1.安装环境: 安装机器:22.224.9.227 以下简称监控机: 操作系统信息:内核版本: Linux version 2.6.18-194.1.AXS3 ([email protected]) (gcc version 4.1.2 20080704 (Asianux 3.0 4.1.2-48)) #1 SMP Fri May 7 10:03:53 CST 2010 发行版本: Red Flag Asianux Server 3 for x86_64 (Quar

zabbix-3.4.14源码安装

此次介绍一下,zabbix的源码安装,因为zabbix的依赖很多,所以源码安装有很多依赖需要安装 首先,下载zabbix源码包 wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/3.4.14/zabbix-3.4.14.tar.gz 下载完成后,解压 tar xf zabbix-3.4.14.tar.gz -C /usr/local/src 进入zabbix解压后的目录 cd /usr/loc

lftp源码安装时 error: Package requirements (gnutls >= 1.0.0) were not met: No package 'gnutls' found

从官网下载源码后,解压./configure后,报错: error: Package requirements (gnutls >= 1.0.0) were not met: No package 'gnutls' found 从 https://www.centos.org/forums/viewtopic.php?t=22228 找到答案: yum install readline-devel yum install gnutls-devel 之后,顺利./configure.make.ma

源码安装zabbix(lnmp+zabbix)

源码安装zabbix 实验环境: [[email protected] ~]# cat /etc/issue CentOS release 6.5 (Final) Kernel \r on an \m 环境要求: 需要准备好实验环境,配置好主机名称 , 网络源(这里我使用的是163网络源),查看并调整好自己的时区以及时间,关闭防火墙iptables   selinux. 安装nginx 需要软件有: nginx-1.8.0.tar.gz  pcre-8.34.tar.gz 安装步骤: 首选安装:

zabbix源码安装流程及报错解决方法

zabbix源码安装流程及报错解决方法 一. zabbix的介绍 1) zabbix是什么 zabbix是一款基于web页面的.开源的.企业级的,支持分布式部署的监控软件. 2)2.zabbix的作用 监控windows和Linux主机上的软硬件状态. 监控各网络设备,如路由器.交换机.防火墙.f5.打印机等. 支持邮件短信微信等平台发送告警通知. 通过web页面及图形展示监控数据. 3)zabbix的特性 由zabbix server和agent程序协同工作,还支持分布式监控,这时需要安装za