问题
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