参照文章进行PostGIS的安装:
./configure --with-pgconfig=/home/postgresql-11.3-1/bin/pg_config --with-geosconfig=/usr/local/geos/bin/geos-config --with-projdir=/usr/local/proj4 --with-gdalconfig=/usr/local/gdal/bin --without-raster
出现错误信息:
configure: error: could not find geos-config within the currentpath. You may need to try re-running configure with a --with-geosconfig parameter.
分析:
在配置的时候是配置了–with-geosconfig参数,同时 指向的路径也是存在的,所以感觉也很奇怪。
后经排查,是有一个依赖未完全安装上导致。重新yum 安装缺失的包。
yum install libxml2-devel sqlite sqlite-devel json-c-devel
ERROR: could not load library "/usr/local/gisspace/pgsql/lib/postgis-3.so": libgeos_c.so.1: cannot open shared object file: No such file or directory
解决方案:
环境变量配置问题解决方案如下:
切换到root用户:su root
打开: vi /etc/ld.so.conf
添加:/usr/local/lib
添加:/usr/local/pgsql/lib
退出执行 :ldconfig