【问题标题】:I cannot run my php script on geoserver我无法在地理服务器上运行我的 php 脚本
【发布时间】:2016-04-21 16:14:27
【问题描述】:

我正在开发一个管理地质文件的网络地图应用程序。 我正在使用 PostgreSQL 和地理服务器 我正在尝试使用 PHP 获取 PostgreSQL 上的数据并将其显示在网页上。 这是我的 php 脚本

 <?php
//mb_internal_encoding("UTF-8");
$conn = pg_connect("host=localhost port=5432 dbname=Gestion_Documents user=****** password=***")
   or die('Connexion impossible : ' . pg_last_error());
$query = 'SELECT * FROM gisement';
$res = pg_query($query) 
    or die('Échec de la requête : ' . pg_last_error());
$cols = pg_num_fields($res);
$rows = pg_num_rows($res);

for ($k = 0; $k < $rows; $k++){
    for ($j = 0; $j < $cols; $j++) {
        $line = pg_fetch_result($res, $k, $j);
        echo '"'.pg_field_name($res, $j).'": '.$line.", ";
    }
    echo "\n";
}
//=========================================
//echo pg_fetch_result($res, 0, 0);
//=========================================
pg_free_result($res);
pg_close($conn);
?>

这个脚本与 Wampserver 完美配合,但是当我尝试在 Geoserver 上运行它时它不起作用 所以我试图找到一种在 Geoserver 上运行脚本的方法。

【问题讨论】:

    标签: php postgresql geoserver


    【解决方案1】:

    GeoServer 没有 PHP 解释器,因此它无法运行您的脚本。您需要在 GeoServer 安装旁边以正常方式运行它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-06-03
      • 1970-01-01
      • 2013-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-08-14
      • 2014-11-29
      相关资源
      最近更新 更多