【问题标题】:Uncaught PHP Exception Exception: "No URL signature provided" in Symfony Application未捕获的 PHP 异常异常:Symfony 应用程序中的“未提供 URL 签名”
【发布时间】:2016-02-24 11:17:17
【问题描述】:

我正在开发一个 Symfony 应用程序 (Mapbender3),并且是这个框架的新手(因为我是 Codeigniter 人)。该应用程序应该使用 ajax 请求加载视图页面,但它没有。我检查了控制台,它说:

Failed to load resource: http://localhost/mapbender3/web/app.php/owsproxy/?url=http%3A%2F%2Flocalhost%2Fmapbender3%2Fweb%2Fapp.php%2Fapplication%2Fmopwmaps%2Finstance%2F9%2Ftunnel&TRANSPARENT=TRUE&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&LAYERS=cite%3ARoad_Master&SRS=EPSG%3A4326&BBOX=62.69026197435,31.478060912429,70.30973802565,35.521939087571&WIDTH=2400&HEIGHT=1273
the server responded with a status of 500 (Internal Server Error)

还有一个错误:

GET http://localhost/mapbender3/web/app.php/owsproxy/?url=http%3A%2F%2Flocalhos…60912429%2C67.942541429504%2C35.521939087571%26WIDTH%3D908%26HEIGHT%3D1273 500 (Internal Server Error)
jquery.js:9659

我跟踪了 jquery.js 文件中的错误,它是:

xhr.send( ( options.hasContent && options.data ) || null );

此外,logs/prod.log 声明:

[2015-11-22 07:54:42] request.CRITICAL: Uncaught PHP Exception Exception: "No URL signature provided" at C:\wamp\www\mapbender3\owsproxy\src\OwsProxy3\CoreBundle\Controller\OwsProxyController.php line 95 {"exception":"[object] (Exception(code: 500): No URL signature provided at C:\\wamp\\www\\mapbender3\\owsproxy\\src\\OwsProxy3\\CoreBundle\\Controller\\OwsProxyController.php:95)"} []
[2015-11-22 07:54:42] security.DEBUG: Write SecurityContext in the session [] []

请告诉我如何解决这个问题。

【问题讨论】:

    标签: php symfony mapbender3


    【解决方案1】:

    这不是 Symfony 错误。当您使用 Google Maps API 时,请求需要包含此处定义的身份验证参数:https://developers.google.com/maps/documentation/business/webservices/auth

    https://maps.googleapis.com/maps/api/geocode/json
      ?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA
      &client=gme-YOUR_CLIENT_ID
      &signature=YOUR_URL_SIGNATURE
    

    【讨论】:

    • 我没有使用谷歌地图。该调用应该从同一个 symfony 应用程序本身加载一些地图。地图是从本地 GeoServer 检索的。
    • @AfghanDeveloper 好的,很抱歉。但我不认为错误来自 Symfony 核心框架,您应该首先使用简单的原始 PHP 测试对本地 GeoServer 的调用。
    • 嗯,连接就在那里,当我加载页面时,地图列表被加载。但点击它们会导致错误状态 500: Internal Server Error
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-09-07
    • 2015-01-04
    • 1970-01-01
    • 2018-05-30
    • 1970-01-01
    • 2014-03-22
    • 2011-09-16
    相关资源
    最近更新 更多