Aiuto!!! Sito in panne

Postate qui discussioni di carattere generale riguardo a problemi di installazione e configurazione di osCommerce

Moderatore: mod Generali

Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Aiuto!!! Sito in panne

Messaggio da jerys1974 »

Ciao a tutti,
questo è il link del mio sito http://www.emanuelcristalli.com/store/catalog/
Cliccate su un articolo qualsiasi e guardate che errore da.
:oops: Sono un po' di giorni che ci sto sopra ma non so dove mettere le mani.:oops:
AIUTOOOOO!!!!!
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Re: Aiuto!!! Sito in panne

Messaggio da marcus »

jerys1974 ha scritto:Ciao a tutti,
questo è il link del mio sito http://www.emanuelcristalli.com/store/catalog/
Cliccate su un articolo qualsiasi e guardate che errore da.
:oops: Sono un po' di giorni che ci sto sopra ma non so dove mettere le mani.:oops:
AIUTOOOOO!!!!!
Probabilmente il tuo hoster ha attivato il Safe mode.

Prova così:

1) Nei configure.php setta il salvataggio delle sessioni sul DB:

Codice: Seleziona tutto

// STORE_SESSIONS
// Session handler - leave empty '' for default handler or set to 'mysql' 
define('STORE_SESSIONS', 'mysql');:
2) In catalog/includes/functions/sessions.php trova:

Codice: Seleziona tutto

function tep_session_save_path($path = '') {
if (!empty($path)) {
return session_save_path($path);
} else {
return session_save_path();
}
}
e modifica con:

Codice: Seleziona tutto

function tep_session_save_path($path = '') {
if (STORE_SESSIONS != 'mysql') { 
if (!empty($path)) {
return session_save_path($path);
} else {
return session_save_path();
}
}
}
Devi fare lo stesso lato admin.

Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

ti ringrazio.
Ora ci provo.
Comunque per il Safe Mode attivato da solo ci avevo pensato ma non è così. Il Safe mode è in off.
Ora provo poi ti faccio sapere.
grazie
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Messaggio da marcus »

jerys1974 ha scritto:ti ringrazio.
Ora ci provo.
Comunque per il Safe Mode attivato da solo ci avevo pensato ma non è così. Il Safe mode è in off.
Ora provo poi ti faccio sapere.
grazie
Dal messaggio di errore:
Warning: session_save_path(): SAFE MODE Restriction in effect. The script whose uid is 31506 is not allowed to access owned by uid 0 in /home/web/www.emanuelcristalli.com/website/store/ ... ssions.php on line 118
sembrerebbe ad on :shock:

Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

Ciao,
Purtroppo o per fortuna ho avuto tanto di quel lavoro questi giorni che solo ora ho potuto mettere le mani sul mio sito.
Ho provato a fare i cambiamenti che mi hai suggerito ma questo è il risultato:
Parse error: parse error, unexpected $ in /home/web/www.emanuelcristalli.com/website/store/ ... ssions.php on line 143
e non si vede altro.
Tra l'altro il configure.php non mi pare fosse diverso da quello che mi hai consigliato di mettere.
Ecco una copia e incolla del configure esistente:
define('USE_PCONNECT', 'false'); // use persistent connections?
define('STORE_SESSIONS', 'mysql'); // leave empty '' for default handler or set to 'mysql'
?>
Ora ricontrollo anche il safe mode ma son sicuro che è spento, anche perché nello stesso server gira un altro OSC che ho fatto per un mio amico e a lui non da errori.
Idee?
grazie[/img]
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

ecco l'httpd:
</VirtualHost>
<VirtualHost www.cristalli.com>
php_admin_flag safe_mode off
php_admin_value max_execution_time 30

se l'indirizzo è giusto "/etc/httpd/conf/httpd.conf" non so che altro modificare.
AIUTOOOOOO!!!!!!!!!!!!!
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Messaggio da marcus »

jerys1974 ha scritto:Ho provato a fare i cambiamenti che mi hai suggerito ma questo è il risultato:
Parse error: parse error, unexpected $ in /home/web/www.emanuelcristalli.com/website/store/ ... ssions.php on line 143
e non si vede altro.
Posta i files:

catalog/includes/functions/sessions.php

e

catalog/admin/includes/functions/sessions.php


Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

questo è il session.php del catalog

<?php
/*
$Id: sessions.php,v 1.19 2003/07/02 22:10:34 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

if (STORE_SESSIONS == 'mysql') {
if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
$SESS_LIFE = 1440;
}

function _sess_open($save_path, $session_name) {
return true;
}

function _sess_close() {
return true;
}

function _sess_read($key) {
$value_query = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'");
$value = tep_db_fetch_array($value_query);

if (isset($value['value'])) {
return $value['value'];
}

return false;
}

function _sess_write($key, $val) {
global $SESS_LIFE;

$expiry = time() + $SESS_LIFE;
$value = $val;

$check_query = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
$check = tep_db_fetch_array($check_query);

if ($check['total'] > 0) {
return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input($expiry) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'");
} else {
return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input($expiry) . "', '" . tep_db_input($value) . "')");
}
}

function _sess_destroy($key) {
return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
}

function _sess_gc($maxlifetime) {
tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");

return true;
}

session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}

function tep_session_start() {
return session_start();
}

function tep_session_register($variable) {
global $session_started;

if ($session_started == true) {
return session_register($variable);
} else {
return false;
}
}

function tep_session_is_registered($variable) {
return session_is_registered($variable);
}

function tep_session_unregister($variable) {
return session_unregister($variable);
}

function tep_session_id($sessid = '') {
if (!empty($sessid)) {
return session_id($sessid);
} else {
return session_id();
}
}

function tep_session_name($name = '') {
if (!empty($name)) {
return session_name($name);
} else {
return session_name();
}
}

function tep_session_close() {
if (PHP_VERSION >= '4.0.4') {
return session_write_close();
} elseif (function_exists('session_close')) {
return session_close();
}
}

function tep_session_destroy() {
return session_destroy();
}

function tep_session_save_path($path = '') {
if (!empty($path)) {
return session_save_path($path);
} else {
return session_save_path();
}
}

function tep_session_recreate() {
if (PHP_VERSION >= 4.1) {
$session_backup = $_SESSION;

unset($_COOKIE[tep_session_name()]);

tep_session_destroy();

if (STORE_SESSIONS == 'mysql') {
session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}

tep_session_start();

$_SESSION = $session_backup;
unset($session_backup);
}
}
?>
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

questo invece è il session dell'admin
P.S.: entrambi i session sono quelli "originali" e non riportano i cambiamenti che mi hai suggerito perché anche se con gli errori così il sito è visibile.
Ciao

<?php
/*
$Id: sessions.php,v 1.9 2003/06/23 01:20:05 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

if (STORE_SESSIONS == 'mysql') {
if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
$SESS_LIFE = 1440;
}

function _sess_open($save_path, $session_name) {
return true;
}

function _sess_close() {
return true;
}

function _sess_read($key) {
$qid = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'");

$value = tep_db_fetch_array($qid);
if ($value['value']) {
return $value['value'];
}

return false;
}

function _sess_write($key, $val) {
global $SESS_LIFE;

$expiry = time() + $SESS_LIFE;
$value = $val;

$qid = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
$total = tep_db_fetch_array($qid);

if ($total['total'] > 0) {
return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input($expiry) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'");
} else {
return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input($expiry) . "', '" . tep_db_input($value) . "')");
}
}

function _sess_destroy($key) {
return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
}

function _sess_gc($maxlifetime) {
tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");

return true;
}

session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}

function tep_session_start() {
return session_start();
}

function tep_session_register($variable) {
return session_register($variable);
}

function tep_session_is_registered($variable) {
return session_is_registered($variable);
}

function tep_session_unregister($variable) {
return session_unregister($variable);
}

function tep_session_id($sessid = '') {
if ($sessid != '') {
return session_id($sessid);
} else {
return session_id();
}
}

function tep_session_name($name = '') {
if ($name != '') {
return session_name($name);
} else {
return session_name();
}
}

function tep_session_close() {
if (function_exists('session_close')) {
return session_close();
}
}

function tep_session_destroy() {
return session_destroy();
}

function tep_session_save_path($path = '') {
if ($path != '') {
return session_save_path($path);
} else {
return session_save_path();
}
}
?>
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Messaggio da marcus »

Questo è il file session lato catalogo modificato come ti avevo consigliato.

Una modifica analoga va fatta per quello lato admin.

Codice: Seleziona tutto

<?php
/*
$Id: sessions.php,v 1.19 2003/07/02 22:10:34 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

if (STORE_SESSIONS == 'mysql') {
	if (!$SESS_LIFE = get_cfg_var('session.gc_maxlifetime')) {
		$SESS_LIFE = 1440;
	}

	function _sess_open($save_path, $session_name) {
		return true;
	}

	function _sess_close() {
		return true;
	}

	function _sess_read($key) {
		$value_query = tep_db_query("select value from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "' and expiry > '" . time() . "'");
		$value = tep_db_fetch_array($value_query);

		if (isset($value['value'])) {
			return $value['value'];
		}

		return false;
	}

	function _sess_write($key, $val) {
		global $SESS_LIFE;

		$expiry = time() + $SESS_LIFE;
		$value = $val;

		$check_query = tep_db_query("select count(*) as total from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
		$check = tep_db_fetch_array($check_query);

		if ($check['total'] > 0) {
			return tep_db_query("update " . TABLE_SESSIONS . " set expiry = '" . tep_db_input($expiry) . "', value = '" . tep_db_input($value) . "' where sesskey = '" . tep_db_input($key) . "'");
		} else {
			return tep_db_query("insert into " . TABLE_SESSIONS . " values ('" . tep_db_input($key) . "', '" . tep_db_input($expiry) . "', '" . tep_db_input($value) . "')");
		}
	}

	function _sess_destroy($key) {
		return tep_db_query("delete from " . TABLE_SESSIONS . " where sesskey = '" . tep_db_input($key) . "'");
	}

	function _sess_gc($maxlifetime) {
		tep_db_query("delete from " . TABLE_SESSIONS . " where expiry < '" . time() . "'");

		return true;
	}

	session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
}

function tep_session_start() {
	return session_start();
}

function tep_session_register($variable) {
	global $session_started;

	if ($session_started == true) {
		return session_register($variable);
	} else {
		return false;
	}
}

function tep_session_is_registered($variable) {
	return session_is_registered($variable);
}

function tep_session_unregister($variable) {
	return session_unregister($variable);
}

function tep_session_id($sessid = '') {
	if (!empty($sessid)) {
		return session_id($sessid);
	} else {
		return session_id();
	}
}

function tep_session_name($name = '') {
	if (!empty($name)) {
		return session_name($name);
	} else {
		return session_name();
	}
}

function tep_session_close() {
	if (PHP_VERSION >= '4.0.4') {
		return session_write_close();
	} elseif (function_exists('session_close')) {
		return session_close();
	}
}

function tep_session_destroy() {
	return session_destroy();
}

function tep_session_save_path($path = '') {
	if (STORE_SESSIONS != 'mysql') {
		if (!empty($path)) {
			return session_save_path($path);
		} else {
			return session_save_path();
		}
	}
}

function tep_session_recreate() {
	if (PHP_VERSION >= 4.1) {
		$session_backup = $_SESSION;

		unset($_COOKIE[tep_session_name()]);

		tep_session_destroy();

		if (STORE_SESSIONS == 'mysql') {
			session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc');
		}

		tep_session_start();

		$_SESSION = $session_backup;
		unset($session_backup);
	}
}
?>


Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

ti ringrazio.
Ora ci provo.
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

FUNZIONAAAA!!!!!
FUNZIONAAAA!!!!!
FUNZIONAAAA!!!!!
FUNZIONAAAA!!!!!
:lol: :lol: :lol: :lol: :lol:

Grazie mille.



:lol: :lol: :lol:
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

mi spiace importunarti nuovamente ma sono solo curioso di sapere cosa può essere successo.
Non ho mai toccato il file session.php e con la stessa base (cioè lo stesso file di OSC) ho creato un altro negozio ad un mio amico che risiede nello stesso server e non da problemi. Ma anche il mio ha funzionato per diversi mesi senza problemi.
Cosa può essere successo?
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
jerys1974
membro Regular
membro Regular
Messaggi: 213
Iscritto il: 07/02/2004, 1:00
Località: Italia
Contatta:

Messaggio da jerys1974 »

non capisco eppure c'è qualcosa che non va.
Lato catalog ok ma il lato admin (che devo dire la verità non avevo controllato) non va.
l'errore è sempre quello:

Warning: session_save_path(): SAFE MODE Restriction in effect. The script whose uid is 31506 is not allowed to access owned by uid 0 in /home/web/www.emanuelcristalli.com/website/store/ ... ssions.php on line 119

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/web/www.emanuelcristalli.com/website/store/ ... ns.php:119) in /home/web/www.emanuelcristalli.com/website/store/ ... ssions.php on line 67

Cosa c'è che non va? Eppure la modifica del file session.php l'ho fatta anche nel lato admin.
Emanuele
----------------------------
www.emanuelcristalli.com
rendiamo la tua vita brillante!
Avatar utente
marcus
membro Master
membro Master
Messaggi: 1619
Iscritto il: 04/12/2003, 1:00
Contatta:

Messaggio da marcus »

jerys1974 ha scritto:non capisco eppure c'è qualcosa che non va.
Lato catalog ok ma il lato admin (che devo dire la verità non avevo controllato) non va.
l'errore è sempre quello:

Warning: session_save_path(): SAFE MODE Restriction in effect. The script whose uid is 31506 is not allowed to access owned by uid 0 in /home/web/www.emanuelcristalli.com/website/store/ ... ssions.php on line 119

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/web/www.emanuelcristalli.com/website/store/ ... ns.php:119) in /home/web/www.emanuelcristalli.com/website/store/ ... ssions.php on line 67

Cosa c'è che non va? Eppure la modifica del file session.php l'ho fatta anche nel lato admin.
Sembrerebbe che per il lato admin non hai abilitato il salvataggio delle sessioni nel DB, il che spiega perchè la modifica che ti ho suggerito non funziona.

Comunque ho dato uno sguardo alla configurazione del PHP:
http://www.emanuelcristalli.com/store/c ... r_info.php

Hai il Safe mode a On!

Se hai accesso al php.ini disabilitalo, altrrimenti chiedi al tuo hoster.

... e non dimenticare di proteggere il pannello di osC :wink:

Marcus
Nuovo pacchetto osCommercePRO (osCPRO) + Modulo Interfacciamento Gestionale Danea.
Visita la demo: http://oscpro.oscommercedev.com/index.php
Rispondi