duanbi1983 2016-04-21 16:14
浏览 66
已采纳

我无法在geoserver上运行我的php脚本

I'm working on a webmapping application that manage geological documents. I'm using PostgreSQL and Geoserver I'm trying to fetch the data on PostgreSQL with PHP and display it on web page. This is my php script

 <?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 "
";
}
//=========================================
//echo pg_fetch_result($res, 0, 0);
//=========================================
pg_free_result($res);
pg_close($conn);
?>

This script work perfectly with Wampserver, But it does not work when i try to run it on Geoserver So I'm trying to find a way to run the script on Geoserver.

  • 写回答

1条回答 默认 最新

  • doushang3352 2016-04-23 19:25
    关注

    GeoServer doesn't have a PHP interpreter so it can't run your script. You need to run it in the normal way beside your GeoServer install.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 matlab中使用gurobi时报错
  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂