Compiling Zabbix 5.2 with libxml2 support

大兔子大兔子 提交于 2020-12-15 04:15:28

问题


I have problem compiling Zabbix 5.2 configured this way:

# ./configure --enable-server --enable-agent   --with-net-snmp --with-libcurl --with-libxml2 --with-postgresql --with-prefix=/usr/local/zabbix5 --verbose
...
checking for PostgreSQL libraries... yes
checking if PostgreSQL version is >= 9.2... yes
checking for Zabbix server/proxy database selection... ok
checking for multirow insert statements... yes
checking for pkg-config... no
checking for pkg-config... no
configure: error: LIBXML2 library not found

Now I have installed libxml2-dev (apt install libxml2-dev). It does show up as libxml2-dev:amd64, not sure why, because the OS is amd64.

I tried setting different environment variables, like export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig/libxml-2.0.pc (that's configuration installed by libxml2-dev:amd64).

I have no idea why this happens or how can I fix it.

OS: Debian 10 amd64.


回答1:


I resolved the issue, the problem is the sources I used come from Debian package (apt source zabbix-server-pgsql) and they're not sources downloaded from Zabbix site.

It appears this problem happens when building in the usual ./configure; make; make install manner. However, when I build the Debian package it works OK:

dpkg-buildpackage -us -uc -nc



回答2:


I just successfully installed Zabbix 5.2 from sources on Ubuntu 16.04. I also got the same error as yours even though I installed the libxml2-dev package. After a day of searching for solutions, I came up with an idea when looking at the error log:

checking for pkg-config... no
configure: error: LIBXML2 library not found

Probably because I have not installed the pkg-config package. Then I tried to install it and run the configuration command again:

sudo apt install pkg-config

./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-libcurl --with-libxml2=/usr/bin/xml2-config

Surprisingly, the configuration was successful.



来源:https://stackoverflow.com/questions/65023947/compiling-zabbix-5-2-with-libxml2-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!