Seite 1 von 1

manuelle installation GeoMap istalation

Verfasst: 22.08.2010 20:49
von siocone
Nach dem alles eingestellt ist und ich beim punkt:
GeoMap Install
Bereit zum Installieren der GeoMap?
angekommen bin erscheint diese meldung:

Fatal error: Allowed memory size of 37748736 bytes exhausted (tried to allocate 31457280 bytes) in /var/www/web899/html/Forum/install/sql_data/sql_data.php on line 9365

soweit klar: zuwenig arbeitsspeicher des servers... aber wie kann ich denn jetzt den script manuel installiern ohne diesen script auszuführen?

Re: manuelle installation GeoMap istalation

Verfasst: 22.08.2010 21:01
von dagobert50gold
Frage deinen Hoster, ob er dir mehr Speicher zur Verfügung stellen kann.

Re: manuelle installation GeoMap istalation

Verfasst: 22.08.2010 21:04
von siocone
habe ich schon das würde ein paketupgrade zurfolge haben was aber voll doof wäre da wir dann 5€ pro monat mehr zahlen würden und quasie nur für eine installations routine... da ja die mod eigentlich nicht mehr arbeitsspeicher brauchen wird...und mehr speicher usw.. wird auch nicht benötigt

Re: manuelle installation GeoMap istalation

Verfasst: 22.08.2010 21:07
von dagobert50gold
Schaue mal in den Quelltext der install-PHP-Datei. Poste sie gegebenenfalls per Pastebin, wenn du die Naweisungen nicht selbst "Übersetzen" willst.

Re: manuelle installation GeoMap istalation

Verfasst: 22.08.2010 21:10
von siocone
hier der quell code der install.php
verstehe aber nur bahnhoff sorry

Code: Alles auswählen

<?php
/**
*
* @author frank1604 (Frank Wiesemann) f.wiesemann@web-coding.eu
* @package umil
* @version $Id index.php 2.2.2 2010-03-03 08:46:08GMT frank1604 $
* @copyright (c) 2010 frank1604
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/

/**
* @ignore
*/
define('UMIL_AUTO', true);
define('IN_PHPBB', true);
define('IN_INSTALL', true);

$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$user->session_begin();
$auth->acl($user->data);
$user->setup('mods/umil_geomap_install');

if (!file_exists($phpbb_root_path . 'umil/umil_auto.' . $phpEx))
{
	trigger_error('Please download the latest UMIL (Unified MOD Install Library) from: <a href="http://www.phpbb.com/mods/umil/">phpBB.com/mods/umil</a>', E_USER_ERROR);
}

// The name of the mod to be displayed during installation.
$mod_name = 'GEOMAP';

/*
* The name of the config variable which will hold the currently installed version
* You do not need to set this yourself, UMIL will handle setting and updating the version itself.
*/
$version_config_name = 'geomap_mod_version';
$language_file = 'mods/umil_geomap_install';

$versions = array(
	'2.1.0'	=> array(
		'table_add'	=> array(
			array(GEOMAP_CONFIG_TABLE, array(
				'COLUMNS' => array(
					'active' => array('INT:1', 1),
					'inactive_text' => array('TEXT', ''),
					'user_color' => array('VCHAR:6', '0000FF'),
					'mod_color' => array('VCHAR:6', '00FF00'),
					'admin_color' => array('VCHAR:6', 'FF0000'),
					'user_pixel' => array('INT:2', 6),
					'mod_pixel' => array('INT:2', 8),
					'admin_pixel' => array('INT:2', 10),
					'max_latitude' => array('DECIMAL', 0),
					'min_latitude' => array('DECIMAL', 0),
					'max_longitude' => array('DECIMAL', 0),
					'min_longitude' => array('DECIMAL', 0),
					'refresh_interval' => array('INT:2', 1),
				),
			)),	
			array(GEOMAP_GROUPS_TABLE, array(
				'COLUMNS' => array(
					'id' => array('UINT:11', NULL, 'auto_increment'),
					'group_id' => array('INT:10', 0),
					'color' => array('VCHAR:6', '00FFFF'),
					'pixel' => array('INT:2', 6),
				),
				'PRIMARY_KEY'	=> 'id',
			)),
			array(GEOMAP_POSTCODE_TABLE, array(
				'COLUMNS' => array(
					'plzid' => array('UINT:11', NULL, 'auto_increment'),
					'plz' => array('VCHAR:5', ''),
					'breite' => array('DECIMAL', 0),
					'laenge' => array('DECIMAL', 0),
					'land' => array('INT:11', 1),
					'ort' => array('VCHAR:100', ''),
				),
				'PRIMARY_KEY'		=> 'plzid'
		))),

		'table_row_insert'	=> array(
				array(GEOMAP_CONFIG_TABLE, array(
						'active'			=> 1,
						'inactive_text' 	=> 'Die Karte wurde vorübergehend deaktiviert. Sie können weiterhin die Wohnorte der eingetragenen Benutzer sehen, jedoch nicht Ihre eigenen Daten ändern oder nach Mitgliedern suchen.',
						'user_color '		=> '0000FF',
						'mod_color '		=> '00FF00',
						'admin_color'		=> 'FF0000',
						'user_pixel'		=> '8',
						'mod_pixel'			=> '10',
						'admin_pixel'		=> '10',
						'max_latitude'		=> 55.3,
						'min_latitude '		=> 45.5,
						'max_longitude'		=> 17.5,
						'min_longitude'		=> 5.5,
						'refresh_interval'	=> 1,
			))
		),

		'custom'	=> 'additional_jobs',

		'table_index_add' => array(
				array(GEOMAP_POSTCODE_TABLE, 'land', 'land'),
				array(GEOMAP_POSTCODE_TABLE, 'plz', 'plz'),
		),

		'module_add'	=> array(
				array('acp', 'ACP_CAT_DOT_MODS', 'GeoMap'),
				array('acp', 'GeoMap', array('module_basename'	=> 'geomap')),
		),

		'table_index_add' => array(
				array(PROFILE_FIELDS_DATA_TABLE, 'plz', 'pf_plz'),
				array(PROFILE_FIELDS_DATA_TABLE, 'land', 'pf_land'),
		),
	),
	'2.2.0'	=> array(
		// nothing changed
	),
	'2.2.1'	=> array(
		// nothing changed
	),
	'2.2.2'	=> array(
		'custom'	=> 'update_cpf_plz',
	),
);

// Include the UMIF Auto file and everything else will be handled automatically.
include($phpbb_root_path . 'umil/umil_auto.' . $phpEx);

function update_cpf_plz($action, $version)
{
	global $db, $table_prefix, $umil, $phpbb_root_path, $phpEx, $user;
	if ($action == 'install')
	{
		$sql_query = array();
		$sql_query[] = 'UPDATE ' . PROFILE_FIELDS_TABLE . ' SET field_type = 2, field_validation = "[0-9]+" WHERE ' . PROFILE_FIELDS_TABLE . '.field_name = "plz"';
		$sql_query[] = 'ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' CHANGE pf_plz pf_plz VARCHAR(5) NULL DEFAULT NULL';
		$sql_query[] = 'UPDATE ' . PROFILE_FIELDS_DATA_TABLE . '
			SET pf_plz = CONCAT("0", pf_plz)
			WHERE pf_plz < 9999
			AND LEFT(pf_plz, 1) > 0
			AND pf_land = 1';

		$db->sql_transaction('begin');
		foreach ($sql_query as $sql)
		{
			$result = $db->sql_query($sql);
		}
		$db->sql_transaction('commit');
		$db->sql_freeresult($result);
		return array(
				'command' => 'GEO_CPF_FIXED',
				'result'  => 'SUCCESS',
			);
	}
	
}
function additional_jobs($action, $version)
{
	if ($action == 'install')
	{
		global $db, $table_prefix, $umil, $phpbb_root_path, $phpEx, $user;
		$postcode_ary = array();

		include($phpbb_root_path . 'install/sql_data/sql_data.php');
		if (empty($postcode_ary)) trigger_error('GEO_SCHEMA_NOT_FOUND');

		foreach ($postcode_ary as $sql_ary)
		{
			$sql = 'INSERT INTO ' . GEOMAP_POSTCODE_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
			$db->sql_query($sql);
		}

		include($phpbb_root_path . 'includes/acp/acp_profile.' . $phpEx);
		include($phpbb_root_path . 'includes/functions_geomap.' . $phpEx);

		$obj_profile = new acp_profile;

		// collect available languages
		$avail_lang = array();
		$sql = 'SELECT lang_id, lang_iso
			FROM ' . LANG_TABLE . '
			ORDER BY lang_english_name';
		$result = $db->sql_query($sql);
		
		while ($row = $db->sql_fetchrow($result))
		{
			$avail_lang[$row['lang_id']] = $row['lang_iso'];
		}
		$db->sql_freeresult($result);

		// collect last order id
		$sql = 'SELECT MAX(field_order) as max_field_order
			FROM ' . PROFILE_FIELDS_TABLE;

		$result = $db->sql_query($sql);
		$new_field_order = (int) $db->sql_fetchfield('max_field_order');
		$db->sql_freeresult($result);


		// define values of the new profile fields
		$profile_fields['plz'] = array(
			'field_length'		=> 5,
			'field_minlen'		=> 4,
			'field_maxlen'		=> 5,
			'field_novalue'		=> '0',
			'field_default_value'	=> '0',
			'field_validation'	=> '[0-9]+',
			'field_required'	=> 0,
			'field_show_on_reg'	=> 1,
			'field_show_profile'=> 1,
			'field_hide'		=> 0,
			'field_no_view'		=> 0,
			'field_type'		=> 2,
			'field_ident'		=> 'plz',
			'field_name'		=> 'plz',
			'field_order'		=> $new_field_order + 1,
			'field_active'		=> 1,
			'lang_vars'		=> array(
				'de'	=> array(
					'lang_name'		=> 'Postleitzahl',
					'lang_explain'		=> 'Wenn du hier deine Postleitzahl angibst, wird deine Position auf der Userkarte angezeigt.',
					'lang_default_value'	=> ''
				),
				'en'	=> array(
					'lang_name'		=> 'Postcode',
					'lang_explain'		=> 'Please insert your postcode. This will show your position on the usermap.',
					'lang_default_value'	=> ''
				)
			)
		);

		$profile_fields['land'] = array(
			'field_length'		=> 0,
			'field_minlen'		=> 0,
			'field_maxlen'		=> 3,
			'field_novalue'		=> 4,
			'field_default_value'	=> 1,
			'field_validation'	=> '',
			'field_required'	=> 0,
			'field_show_on_reg'	=> 1,
			'field_show_profile'=> 1,
			'field_hide'		=> 0,
			'field_no_view'		=> 0,
			'field_type'		=> 5,
			'field_ident'		=> 'land',
			'field_name'		=> 'land',
			'field_order'		=> $new_field_order + 2,
			'field_active'		=> 1,
			'lang_vars'		=> array(
				'de' => array(
					'lang_name'		=> 'Land',
					'lang_explain'		=> 'Bitte wähle dein Land aus.',
					'lang_default_value'	=> '',
					'l_options'		=> array(
						'Deutschland',
						'Oesterreich',
						'Schweiz',
						'nicht ausgewählt'
					)
				),
				'en' => array(
					'lang_name'		=> 'Country',
					'lang_explain'		=> 'Please select your country.',
					'lang_default_value'	=> '',
					'l_options'		=> array(
						'Germany',
						'Austria',
						'Swiss',
						'not selected'
					)
				)
			)
		);

		// initialize $profile_sql array
		$profile_sql = array();

		// create profile fields
		foreach($profile_fields as $field => $field_values) 
		{
			if (!profile_field_exists($field))
			// field doesn`t exists, create it
			{
				// copy the information temporarly and unset the values we don't need
				$tmp_profile_fields = $profile_fields[$field];
				unset($tmp_profile_fields['lang_vars']);

				// create the fields
				$sql = 'INSERT INTO ' . PROFILE_FIELDS_TABLE . ' ' . $db->sql_build_array('INSERT', $tmp_profile_fields);
				$db->sql_query($sql);

				// build sql for new field
				$field_id = $db->sql_nextid();
				$profile_sql[] = $obj_profile->add_field_ident('pf_'.$field, 1);

				// collect fieldvalues for each language, if not defined use english
				foreach($avail_lang as $lang_id => $lang_iso)
				{
					$lang = isset($field_values['lang_vars'][$lang_iso]) ? $lang_iso : 'en';

					$sql_ary = array(
						'lang_name'		=> $field_values['lang_vars'][$lang]['lang_name'],
						'lang_explain'		=> $field_values['lang_vars'][$lang]['lang_explain'],
						'lang_default_value'	=> ''
					);
					$sql_ary['field_id'] = $field_id;
					$sql_ary['lang_id'] = $lang_id;

					$profile_sql[] = 'INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);

					//if there are language options, collect them too
					if (isset($field_values['lang_vars'][$lang]['l_options']))
					{
						foreach($field_values['lang_vars'][$lang]['l_options'] as $option_id => $value)
						{

							// unset $sql_ary and give new values
							$sql_ary = array('lang_value' => $value);
							$sql_ary['field_id'] = $field_id;
							$sql_ary['lang_id'] = $lang_id;
							$sql_ary['option_id'] = (int) $option_id;
							$sql_ary['field_type'] = $profile_fields[$field]['field_type'];

							$profile_sql[] = 'INSERT INTO ' . PROFILE_FIELDS_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
						}
					}
				}
			}
		}

		$profile_sql[] = 'ALTER TABLE ' . $table_prefix . 'profile_fields_data CHANGE pf_plz pf_plz VARCHAR(5) NULL DEFAULT NULL';

		// and.. action! Give the collected values to database and create the fields
		$db->sql_transaction('begin');
		foreach ($profile_sql as $sql)
		{
			$result = $db->sql_query($sql);
		}
		$db->sql_transaction('commit');
		$db->sql_freeresult($result);

		$command = $user->lang['GEO_POSTCODE_DATA_INSERTED'] . ', ' . $user->lang['GEO_PROFILE_FIELDS_CREATED'];
		return array(
				'command' => $command,
				'result'  => 'SUCCESS',
			);
	}
}
?> 

Re: manuelle installation GeoMap istalation

Verfasst: 22.08.2010 21:17
von dagobert50gold
Da geht es um die SQL-Befehle. Die führt meistens die .php-Datei aus.

Pastebin ist oben verfügbar (neben dem Chat).

Re: manuelle installation GeoMap istalation

Verfasst: 22.08.2010 21:18
von 7emper5i
Schau eher in die sql_data.php, denn das ist auch die Datei, die die Probleme verursacht, bzw einfach nur ein wenig mehr Arbeitsspeicher fordert. Die install.php ruft diese Datei auch nur auf.

Code: Alles auswählen

include($phpbb_root_path . 'install/sql_data/sql_data.php');
Der Mod-Ersteller kann dir da aber sicher eher weiterhelfen, denn wir.

Re: manuelle installation GeoMap istalation

Verfasst: 22.08.2010 21:20
von siocone
ok werde mal den modder versuchen zu kontaktieren....

Re: manuelle installation GeoMap istalation

Verfasst: 22.08.2010 22:35
von franki
dagobert50gold hat geschrieben:Frage deinen Hoster, ob er dir mehr Speicher zur Verfügung stellen kann.
Das heist "memory_limit". Speicher gibt es auch auf einer Festplatte.
dagobert50gold hat geschrieben:Schaue mal in den Quelltext der install-PHP-Datei. Poste sie gegebenenfalls per Pastebin, wenn du die Naweisungen nicht selbst "Übersetzen" willst.
Was willst Du da finden oder ändern ? Evtl. ein paar Anweisungen entfernen ?
dagobert50gold hat geschrieben:Da geht es um die SQL-Befehle. Die führt meistens die .php-Datei aus.

Pastebin ist oben verfügbar (neben dem Chat).
Klar wenn eine Tabelle in der Datenbank erstellt werden soll :o
Aus einer install.php was zu entfernen - böse Falle für einen der sich nicht auskennt.

Re: manuelle installation GeoMap istalation

Verfasst: 23.08.2010 17:35
von dagobert50gold
franki hat geschrieben:Klar wenn eine Tabelle in der Datenbank erstellt werden soll :o
Aus einer install.php was zu entfernen - böse Falle für einen der sich nicht auskennt.
Habe ich was von entfernen gesagt? Ich habe nur gesagt, man könne ALLE Befehle rausnehmen uns ausführen. Das ist nur eine Menge Arbeit ...