I tried to install GMap on Drupal 5.1. When I try to configure it, it gives me a internal server error.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | cast_arrays.patch | 1.75 KB | owen barton |
| #3 | httpd.conf_.txt | 18.23 KB | xl-network |
I tried to install GMap on Drupal 5.1. When I try to configure it, it gives me a internal server error.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | cast_arrays.patch | 1.75 KB | owen barton |
| #3 | httpd.conf_.txt | 18.23 KB | xl-network |
Comments
Comment #1
michaelfavia commentedIf you dont provide more information it is nearly impossible to help you. Please put in at least as much time as youd like someone else to.
Comment #2
xl-network commentedWhat would you like to know? I can tell you this: I'ts a clean 5.1 install with only the GMap module installed. My site is hosted at one.com, and on my localhost it also does'nt run. It does'nt give me a error (on my own computer) but the page keeps loading (on my webhost the error appears). If you'd like I can attach my httpd.conf or a error file. btw. I hav'nt found anything in the error file, but then again I am no hard-core PHP programmer.
Comment #3
xl-network commentedSome more information. I tried it on another computer (XP, no clean 5.1 install though, but I disabled most contrib. modules). Same result but now I get the typical XP 'your-program-has-crashed' screen for Apache. So it look's like Apache crashed. I use the default 2.2 installation with this piece added to the end of my httpd.conf
Hope this helps...
Btw. I attached the httpd.conf from my 3rd machine, the one I described in this post.
Comment #4
owen barton commentedI had the same problem - which needed quite a bit of bug searching to figure out (Apache 500 errors are not exactly helpful!).
I tracked this down to PHP 5 (it works fine in PHP 4), and then to some lines that were array_merging variables without first casting them to arrays (PHP 5 is stricter in this regard - PHP 4 would just automatically cast to the array type).
I am not quite sure why it was crashing PHP (as the logs indicated), possibly some unintended infinite recursion.
Anyway, here is a patch that fixes this for the cases I could find. I haven't tested much other functionality yet, so there could be other PHP 5 issues lurking - but this is enough to at least get the map on the settings page working cleanly.
Comment #5
stella commentedI have the same issue every time I visit the Node Locations or User Locations pages. I downloaded everything from CVS yesterday with the DRUPAL-5 tag. I have the following location modules installed - Location, Location Views, GMap, GMap Macro Builder, GMap Views Integration and KML. I also found the following errors in my /var/log/messages file. The first error happened when I visited node locations, the 2nd for user locations.
I also found the following errors in my webserver error logfile for each time I got the 500 Internal Server Error
By the way, this is a new test site so I have no users or nodes with locative information yet.
Cheers,
Stella
Comment #6
owen barton commentedHi snpower,
These are the exact same errors I had. I have successfully viewed both user and node maps since applying this patch.
Could you try the above patch and let me know if you still have these errors?
Thanks!
Comment #7
stella commentedYep that worked for me. Thanks.
Stella
Comment #8
xl-network commentedIt (applying the patch) still does'nt work for me. I tried it on 2 different PC's (pretty much the same configuration)
PS. I don't know how to apply a patch, so I changed the lines manualy.
I'm using (on Windows XP):
Comment #9
bdragon commentedI committed some changes that should hopefully fix this. http://drupal.org/cvs?commit=56794 is the commit number.
Comment #10
xl-network commentedNope... still does'nt work. Btw. I get this error in the error.log (along with a 'your program has crashed' (Apache), typical windows screen).
Comment #11
bdragon commentedMarking as master issue for "settings page crashes PHP5."
Duplicates marked:
http://drupal.org/node/119931
http://drupal.org/node/120012
Comment #12
stella commentedJust fyi, the latest version from CVS fixes this problem and issue http://drupal.org/node/118816 for me. I'm running lighttpd/1.4.11, php 5.1.2 and mysql 5.0.22 on ubuntu.
Comment #13
owen barton commentedLatest CVS fixes this for me - thanks!
Marking closed - we can reopen if further issues are found.
Comment #14
mcreature commentedI am still getting a PHP 500 error when clicking on admin/settings/gmap
This is with a fresh install of gmap 5x1 dev from feb 20th also fresh install of drupal 5.1
Comment #15
mcreature commentedoops forgot my server info, here it is ...
MySQL database 5.0.27
PHP 5.2.0
Comment #16
mcreature commentedsetting this back to active
Comment #17
xl-network commentedStill does'nt work for me (tested on 2 of my computers and my hosting company). I want to help fix this issue, so tell my what I should test/try etc.
Comment #18
owen barton commentedI can't reproduce this problem (I have PHP 5.1.6).
The easiest way to fix crashes is with an interactive debugger, such and GDB or Xdebug. If that is too hard to set up/use, then an alternative is to go through the code for the settings page & form, putting print "1"; print "2"; etc at various intervals (and turn PHP output buffering off), and see where it counts up to before it crashes, to isolate the line that is the problem. You can also do a similar thing be successively commenting out blocks of code, until it starts working again, and then uncomment the in the same order until it breaks, rinse and repeat until you find the problem line.
Alternatively, a good read through the code looking for places where arrays aren't being initialized might turn up something too.
Comment #19
stella commentedIt might be a php 5.2 related issue, since the solutions seems to only have worked for people with 5.1.x installed so far.
Stella
Comment #20
xl-network commentedCould be... all my machines (including my webhost) are running 5.2.x
My webhost 'status settings'.
Comment #21
evave commentedI could replicate this issue with PHP 5.1.6 and the problem is within following block of code in gmap_settings_ui.inc.
$form['markermanager']['gmap_mm_type'] = array(
'#type' => 'radios',
'#parents' => array(),
'#options' => array(
'gmap_marker.js' => t('No manager (use addOverlay directly)'),
'gmarkermanager_marker.js' => t("Google's GMarkerManager"),
'clusterer_marker.js' => t("Jef Poskanzer's Clusterer"),
),
//'#default_value' => variable_get('g
'#description' => t('If you are planning on using many markers on a single map, you may want to consider using a marker manager to speed up map rendering.'),
);
Rgds
Comment #22
stella commentedif you remove the line that's commented out does it improve things? maybe php isn't handling that line correctly... there is one open ( but no closing. I know it shouldn't care about it since it's commented out, but I can't see anything else vaguely dodgy with that code.
Stella
Comment #23
owen barton commentedThe problem is almost certainly with the #options element. This is a FAPI custom form widget field for gmap, and is handled by this function:
/*** Implementation of hook_elements().
*/
function gmap_elements() {
return array(
'gmap' => array(
'#input' => FALSE, // This isn't a *form* input!!
'#settings' => array_merge(gmap_defaults(),array(
'points' => array(),
'pointsOverlays' => array(),
'lines' => array(),
)),
'#process' => array('expand_gmap' => array()),
),
'gmap_macrotext' => array(
'#input' => TRUE,
'#cols' => 60,
'#rows' => 5,
'#process' => array(
'process_gmap_control' => array('textarea','macrotext')
),
),
'gmap_overlay_edit' => array('#input' => FALSE, '#process' => array('process_gmap_overlay_edit' => array())),
'gmap_address' => array('#input' => FALSE, '#process' => array('process_gmap_address' => array())),
'gmap_align' => array('#input' => TRUE, '#process' => array('process_gmap_align' => array())),
'gmap_latitude' => array('#input' => TRUE, '#process' => array('process_gmap_control' => array('textfield','latitude','gmap_coord'))),
'gmap_longitude' => array('#input' => TRUE, '#process' => array('process_gmap_control' => array('textfield','longitude','gmap_coord'))),
'gmap_latlon' => array('#input' => TRUE, '#process' => array('process_gmap_control' => array('textfield','latlon','gmap_coord'))),
'gmap_markerchooser' => array('#input' => TRUE, '#process' => array('process_gmap_markerchooser' => array())),
);
}
This then hands control, (via the callbacks) to process_gmap_control():
/*** Generic gmap control processor
*/
function process_gmap_control($element,$edit,$fieldtype,$control,$theme='') {
$element['#type'] = $fieldtype;
gmap_widget_setup($element, $control);
if (!empty($theme)) {
$element['#theme'] = $theme;
}
else {
$element['#theme'] = 'gmap_'.$control;
}
return $element;
}
If you can isolate the issue further within these functions, that would be a big help!
Comment #24
evave commentedthe comment in the code is OK, the same problem without it.
Commenting out the functions you've suggested doesn't help. And the problem is certainly in the following lines (commenting them Apache doesn't crash):
// 'gmap_marker.js' => t('No manager (use addOverlay directly)'),
// 'gmarkermanager_marker.js' => t("Google's GMarkerManager"),
// 'clusterer_marker.js' => t("Jef Poskanzer's Clusterer"),
Comment #25
xl-network commentedMe to... if I comment them out it works... well at least it does'nt give me a error.
Comment #26
xl-network commentedI think I have solved it... (just comment '#parents' => array(), out). Can anyone confirm this?
Comment #27
bdragon commentedWait a second...
Why the heck did I write that like that? There's no way that code works. The correct solution is to explicitly set #tree to FALSE.
I just committed a fix for gmap_mm_type so it no longer pretends it's a form element with NULL for the key. Sheesh, no wonder PHP was crashing...
Comment #28
Anonymous (not verified) commentedThe new dev version now no longer crashes on a windows test machine running Apache 2.2.3 and PHP 5.2.0. Great work. Thanks.
Comment #29
bdragon commentedComment #30
(not verified) commented