问题描述
我已经在64位Windows上安装了OSGeo4W.我正在尝试在GeoPHP中使用GEOS
函数,但是当我调用geoPHP::geosInstalled
时,它将返回我false
.这就是我包含库的方式:
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());
输出为:
bool(false)
我已经安装了oSGeo4W
,据说此处要包含GEOS
.它安装在C:\OSGeo4W64
中,并且已将C:\OSGeo4W64
和C:\OSGeo4W64\bin
放入我的path
环境变量中,并重新引导了系统一次.我想念什么?
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?
推荐答案
GeoPHP 网站说:
要安装带有PHP扩展名的GEOS,您需要从源代码进行编译.这听起来可能很吓人,但确实非常简单!有关安装GEOS(带有必需的PHP扩展名)的各种说明,可以在这里找到:
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:请参阅如何在Ubuntu Trusty 14.04 LTS上使用PHP5绑定安装libgeos
Ubuntu: See Howto install libgeos with PHP5 bindings on Ubuntu Trusty 14.04 LTS
MAMP用户:有关特殊要求,请参阅在带有MAMP的OSX上安装GEOS.
MAMP users: See GEOS Installation on OSX with MAMP for special requirements.
CentOS 6用户:有关特殊说明,请参阅CentOS6上的GEOS安装.
CentOS 6 users: See GEOS Installation on CentOS6 for special instructions.
因此,有必要在使用GEOPHP扩展类之前对其进行编译,可能需要花一些时间在Windows OS上进行此操作.
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!
这篇关于GeoPHP geosInstalled返回false的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!