Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) session_start():


Guest Evandro

Pergunta

Esta dando o seguinte erro no topo

Warning: session_start(): open(/tmp\sess_230f7e8adc96de1f592fefc99c5cc259, O_RDWR) failed: No such file or directory (2) in c:\arquivos de programas\easyphp1-8\www\auto_pecas_site\osc\includes\functions\sessions.php on line 97

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at c:\arquivos de programas\easyphp1-8\www\auto_pecas_site\osc\includes\functions\database.php:12) in c:\arquivos de programas\easyphp1-8\www\auto_pecas_site\osc\includes\functions\sessions.php on line 97

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at c:\arquivos de programas\easyphp1-8\www\auto_pecas_site\osc\includes\functions\database.php:12) in c:\arquivos de programas\easyphp1-8\www\auto_pecas_site\osc\includes\functions\sessions.php on line 97

Warning: I am able to write to the configuration file: c:/arquivos de programas/easyphp1-8/www/auto_pecas_site/osc/includes/configure.php. This is a potential security risk - please set the right user permissions on this file.

Warning: The sessions directory does not exist: /tmp. Sessions will not work until this directory is created.

---------------------- Session.php

<?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 © 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() {

global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;

$sane_session_id = true;

if (isset($HTTP_GET_VARS[tep_session_name()])) {

if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_GET_VARS[tep_session_name()]) == false) {

unset($HTTP_GET_VARS[tep_session_name()]);

$sane_session_id = false;

}

} elseif (isset($HTTP_POST_VARS[tep_session_name()])) {

if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_POST_VARS[tep_session_name()]) == false) {

unset($HTTP_POST_VARS[tep_session_name()]);

$sane_session_id = false;

}

} elseif (isset($HTTP_COOKIE_VARS[tep_session_name()])) {

if (preg_match('/^[a-zA-Z0-9]+$/', $HTTP_COOKIE_VARS[tep_session_name()]) == false) {

$session_data = session_get_cookie_params();

setcookie(tep_session_name(), '', time()-42000, $session_data['path'], $session_data['domain']);

$sane_session_id = false;

}

}

if ($sane_session_id == false) {

tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false));

}

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);

}

}

?>2

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

O primeiro erro está causando os outros...

Warning: session_start(): open(/tmp\sess_230f7e8adc96de1f592fefc99c5cc259, O_RDWR) failed: No such file or directory (2) in c:\arquivos de programas\easyphp1-8\www\auto_pecas_site\osc\includes\functions\sessions.php on line 97

Está dizendo que não pode abrir o arquivo e/ou o diretório... provavelmente é a configuração do seu PHP... dê uma conferida no fórum da OSC, eles tem um guia pra configurar o PHP de modo que a loja rode perfeitamente.

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      652k
×
×
  • Criar Novo...