GeoPHP geosInstalled returns false

谁说我不能喝 提交于 2019-12-11 07:21:30

问题


I have installed OSGeo4W on my 64-bit windows. I am trying to use GEOS functions in GeoPHP, but when I call geoPHP::geosInstalled, it returns me false. This is how I included the libraries:

<?php
echo "Going to load libraries...\n";
include_once("C:\\Users\\ZiZi\\Desktop\\GEOPHP\\Libs\\geoPHP-master\\geoPHP.inc");
var_dump(geoPHP::geosInstalled());

The output is:

bool(false)

I have installed oSGeo4W which is said here to be containing GEOS. It is installed in C:\OSGeo4W64 and I have put C:\OSGeo4W64 and C:\OSGeo4W64\bin into my path environment variable and rebooted the system once. What did I miss?


回答1:


The GeoPHP website says:

Installation

To install GEOS with it's PHP extension, you need to compile it from source. This may sound scary, but it's really quite easy! Various instructions on installing GEOS (with the requisite PHP extension) can be found here:

http://wygoda.net/blog/testing-geos-33-php-bindings (Best Instructions)
http://trac.osgeo.org/geos/wiki/BuildingOnUnixWithAutotools
http://trac.osgeo.org/geos/wiki/BuildingOnUnixWithCMake

Ubuntu: See Howto install libgeos with PHP5 bindings on Ubuntu Trusty 14.04 LTS

MAMP users: See GEOS Installation on OSX with MAMP for special requirements.

CentOS 6 users: See GEOS Installation on CentOS6 for special instructions.

So, it's necessary to compile the GEOS with GeoPHP extension before to use their class, probably will be necessary dedicate some time to do this on Windows OS.

I hope it helps and good luck!



来源:https://stackoverflow.com/questions/54047221/geophp-geosinstalled-returns-false

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