[Mapbender-users] Difference in app.php and app_dev.php?

Axel Schaefer axel.schaefer at wheregroup.com
Wed Sep 27 05:59:16 PDT 2017


Hi Teresa.

Normally app_dev.php is only for development or testing. Don't use it in 
production!

app.php is "production mode" and should be referenced as the default 
page. app_dev.php is "development mode" and should only be used for 
checks. Normally app_dev.php is only callable via localhost.

Differences:

app_dev.php shows PHP errors directly in browser. With stack trace. 
Normally you'll find the error in the prod.log file under 
mapbender/app/logs.

app_dev.php doesn't create the full cache in app/cache. Some files are 
omitted in developer mode, which is useful for developing.

app_dev.php prints out a lot of stuff in the blue upper right dialog on 
Digitizer. :D

http://doc.mapbender.org/en/book/installation/configuration.html#production-and-development-environment-and-caching-app-php-and-app-dev-php

Which mode do you want to use for modifiying an app?
Prod-mode.

Which mode do you want to use for developing an app?
Dev-Mode.

 > Do you know, why the both modes are acting so
 > differnt?

Not right now. You can try to clean the cache. The contents in 
mapbender/app/cache/ (not the folder itself).

 > Do I have to do special or additional configurations?

No.

Best regads.
Axel



Am 27.09.2017 um 14:48 schrieb Teresa Graßl:
> Hello,
> 
> I´m confused about two parts of MapBender. I created a new application 
> under _http://localhost/mapbender3/manager/applications._ When I add the 
> element digitizer (please see added e-mail) in my content-part of 
> layouts and connect my database, following error occurs by starting the 
> application:
> 
> /
>> Feature API query error."<!DOCTYPE html>\n<html>\n <head>\n <meta 
> charset=\"UTF-8\" />\n <title>An Error Occurred: Internal Server 
> Error</title>\n </head>\n <body>\n <h1>Oops! An Error Occurred</h1>\n 
> <h2>The server returned a \"500 Internal Server Error\".</h2>\n\n 
> <div>\n Something is broken. Please let us know what you were doing when 
> this error occurred.\n We will fix it as soon as possible. Sorry for any 
> inconvenience caused.\n </div>\n </body>\n</html>\n"/
> /
> /
> I read in a forum comment, that one solution is to start the application 
> in the developement mode under 
> _http://localhost/mapbender3/app_dev.php/manager/applications_. By doing 
> this, the element digitizer works fine and no errors occur by starting 
> the application. But now: by editing any element "button" (layouts -> 
> toolbar) an error occurs:/internal server error/. Other elements in the 
> toolbar as well as in the content and footer can by edited without 
> problems. Only the element "button" does not work. The tricky thing is, 
> that working under _http://localhost/mapbender3/manager/applications_ 
> all elements "button" are working fine and are easily editable._
> _
> 
> For the use of my application, I don´t want to open it in the 
> developement mode! Do you know, why the both modes are acting so 
> differnt? Do I have to do special or additional configurations? Which 
> mode is best for using it and modifying an application?
> 
> Thank you so much in advance!
> 
> Best regards
> Teresa
> 
> 
> //
> ---------- Forwarded message ----------
> From: *Teresa Graßl* <teresagrassl91 at gmail.com 
> <mailto:teresagrassl91 at gmail.com>>
> Date: 2017-09-22 16:01 GMT+02:00
> Subject: Re: [Mapbender-users] Mapbender don´t show map
> To: Mapbender User List <mapbender_users at lists.osgeo.org 
> <mailto:mapbender_users at lists.osgeo.org>>
> 
> 
> Hello Charlotte,
> 
> maybe you can help me again.
> 
> I´ve added the element "digitizer" and entered following yml-file:
> 
> *bohrdaten:
>      label: Punkt Digitalisierung
>      inlineSearch: true
>      maxResults: 500
>      featureType:
>          connection: Bohrpunkte_NP
>          table: bohrdaten
>          uniqueId: id
>          geomType: point
>          geomField: geom
>          srid: 4326
>      openFormAfterEdit: true
>      zoomScaleDenominator: 500
>      allowEditData: true
>      allowDelete: true
>      allowDigitize: true
>      useContextMenu: true
>      useCancelButton: true
>      toolset:
>          - type: drawPoint
>          - type: moveFeature
>      popup:
>          title: Editieren Bohrpunkte
>          width: 500px
>      searchType: currentExtent
>      tableFields:
>          id: {label: Nr.}
>          projektnummer: {label: Projekt}
>          adresse: {label: Adresse}
>          beschreibung: {label: Beschreibung}
>          datum: {label: Datum}
>          gw_flurabstand: {label: GW-Flurabstand [m]}
>          gw_maechtigkeit: {label: GW-Mächtigkeit [m]}
>          gok: {label: GOK [m ü. NN]}
>          gwo: {label: GWO [m ü. NN]}
>          tertiaer_ok: {label: Tertiär-OK [m ü. NN]}
>          erschliessung: {label: Erschließung}
>          nutzung: {label: Nutzung}
>      styles:
>          default:
>              strokeWidth: 2
>              strokeColor: '#0e6a9e'
>              fillColor: '#1289CD'
>              fillOpacity: 1
>              fillWidth: 2
>              pointRadius: 10
>          select:
>              strokeWidth: 3
>              strokeColor: '#0e6a9e'
>              fillOpacity: 0.7
>              pointRadius: 10
>      formItems:
>         - type: tabs
>           children:
>             - type: form
>               title: Basisinformationen
>               css: {padding: 10px}
>               children:
>                   - type: label
>                     title: Hier kannst du einen neuen Bohrpunkt erfassen!
>                   - type: input
>                     title: Projekt
>                     mandatory: true
>                     name: projektnummer
>                     mandatoryText: Hoppla. Unvollständige Eingabe!
>                     infoText: "Bitte gib eine Projektnummer an!"
>                     placeholder: "z.B. 1234 oder 1234-1"
>                   - type: textArea
>                     title: Adresse
>                     name: adresse
>                     rows: 2
>                   - type: select
>                     title: Erschließung
>                     name: erschliessung
>                     multiple: false
>                     options: {1: Rammsondierung, 2: Kleinbohrung, 3: 
> Bohrung}
>                     infoText: "Hier kann angegeben werden, wie der 
> Bohrpunkt erschlossen wurde"
>                   - type: select
>                     title: Nutzung
>                     name: nutzung
>                     multiple: false
>                     options: {1:Erkundung, 2:GWM, 3:Geothermie}
>                     infoText: "Hier kann angegeben werden, wie der 
> Bohrpunkt genutzt wird"
>                   - type: input
>                     title: Beschreibung
>                     name: beschreibung
>                     mandatory: false
>                     placeholder: "Hier können zusätzliche Informationen 
> angegeben werden."
>                   - type: date
>                     title: Datum
>                     name: datum
>                     placeholder: "z.B. 01.01.2017"
>                     dateFormat: dd.mm.yy
>                     infoText: "Das Datum wird im Format dd.mm.yy angegeben."
>             - type: form
>               title: Details
>               css: {padding: 10px}
>               children:
>                   - type: label
>                     title: Bitte gib hier weitere Informationen zum 
> Bohrpunkt an!
>                   - type: fieldSet
>                     children:
>                         - type: input
>                           title: GW-Flurabstand [m]
>                           name: gw_flurabstand
>                           css: {width: 33%}
>                         - type: input
>                           title: GW-Mächtigkeit [m]
>                           name: gw_maechtigkeit
>                           css: {width: 33%}
>                         - type: input
>                           title: GWO [m ü. NN]
>                           name: gwo
>                           css: {width: 33%}
>                   - type: fieldSet
>                     children:
>                         - type: input
>                           title: GOK [m ü. NN]
>                           name: gok
>                           css: {width: 50%}
>                         - type: input
>                           title: Tertiär-OK [m ü. NN bzw. m unter GOK]
>                           name: tertiaer_ok
>                           css: {width: 50%}*
> 
> I added two database-connection to my config.yml and my parameters.yml 
> (like explained in https://doc.mapbender3.org/de/book/database.html 
> <https://doc.mapbender3.org/de/book/database.html>):
> 
> 1) in the config.yml
> *doctrine:
>      dbal:
>          default_connection: default
>          connections:
>              # Datenbankverbindung default
>              default:
>                  driver:   %database_driver%
>                  host:     %database_host%
>                  port:     %database_port%
>                  dbname:   %database_name%
>                  path:     %database_path%
>                  user:     %database_user%
>                  password: %database_password%
>                  persistent: true
>                  charset:  UTF8
>                  logging: %kernel.debug%
>                  profiling: %kernel.debug%
>              # Datenbankverbindung Bohrpunkte_NP
>              Bohrpunkte_NP:
>                  driver:   %database2_driver%
>                  host:     %database2_host%
>                  port:     %database2_port%
>                  dbname:   %database2_name%
>                  path:     %database2_path%
>                  user:     %database2_user%
>                  password: %database2_password%
>                  persistent: true
>                  charset:  UTF8
>                  logging: %kernel.debug%
>                  profiling: %kernel.debug%
> *
> *
> *
> 2) In the parameters.yml
> *parameters:
>      # Datenbankverbindugn default
>      database_driver:   pdo_pgsql
>      database_host:     localhost
>      database_port:     5432
>      database_name:     mapbender3
>      database_path:     ~
>      database_user:     postgres
>      database_password: ****
> 
>      #Datenbankverbindung Bohrpunkte_NP
>      database2_driver:   pdo_pgsql
>      database2_host:     localhost
>      database2_port:     5432
>      database2_name:     Bohrpunkte_NP
>      database2_path:     ~
>      database2_user:     postgres
>      database2_password: ****
> 
>      mailer_transport:  smtp
>      mailer_host:       localhost
>      mailer_user:       ~
>      mailer_password:   ~*
> 
> After updating and return to my application following error occured:
> 
> /
> ​​
> Feature API query error."<!DOCTYPE html>\n<html>\n <head>\n <meta 
> charset=\"UTF-8\" />\n <title>An Error Occurred: Internal Server 
> Error</title>\n </head>\n <body>\n <h1>Oops! An Error Occurred</h1>\n 
> <h2>The server returned a \"500 Internal Server Error\".</h2>\n\n 
> <div>\n Something is broken. Please let us know what you were doing when 
> this error occurred.\n We will fix it as soon as possible. Sorry for any 
> inconvenience caused.\n </div>\n </body>\n</html>\n"/
> 
> When I import my application in the develover environment 
> _http://localhost/mapbender3/app_dev.php/application/bp 
> <http://localhost/mapbender3/app_dev.php/application/bp>_ and open my 
> application, everything´s working (no error).//So I´m confused, why in 
> the app_dev.php it works, but not at the frontend 
> _http://localhost/mapbender3/application/bp 
> <http://localhost/mapbender3/application/bp>_? Do I have to do special 
> oder additional configurations?
> //
> 
> Thank you in advance and have a nice weekend
> Cheers,
> Teresa
> 
> 
> _______________________________________________
> Mapbender_users mailing list
> Mapbender_users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapbender_users
> 

-- 
Axel Schaefer
WhereGroup GmbH & Co. KG
Eifelstraße 7
53119 Bonn
Germany

Fon: +49 (0)228 / 90 90 38 - 23
Fax: +49 (0)228 / 90 90 38 - 11

axel.schaefer at wheregroup.com
www.wheregroup.com | www.mapbender.org | www.meldemax.com
Amtsgericht Bonn, HRA 6788
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Olaf Knopp, Peter Stamm
-------------------------------


More information about the Mapbender_users mailing list