veeraa2003 Posted January 20, 2007 Share Posted January 20, 2007 Hello everybody........I used session function to start it in my PHP page . I got some error , Please give some ideas to rectify it. I provided both of sample of my code and error message. Please go through it .[code]<?phpini_set('mbstring.internal_encoding', 'UTF-8');ini_set('mbstring.http_output', 'UTF-8');ini_set('mbstring.detect_order', 'UTF-8');ini_set('mbstring.substitute_character', '12307');// When did we start?define('START_TIME', microtime(true)); $sys_path = str_replace('/system', '', dirname(__FILE__));// Setup pathsdefine('DS', DIRECTORY_SEPARATOR);define('ROOT', $sys_path);define('APP', ROOT . DS . 'app');define('APP_MODELS', APP . DS . 'models');define('APP_CONTROLLERS', APP . DS . 'controllers');define('APP_VIEWS', APP . DS . 'views');define('SYS', ROOT . DS . 'system');define('SYSDRIVERS', ROOT . DS . 'system' . DS . 'drivers');define('LIB', ROOT . DS . 'lib');define('CONFIG', ROOT . DS . 'config');define('SESSION_USER', 'user');echo ROOT;session_save_path(ROOT . DS . 'tmp' . DS . 'sessions');session_name(SESSION_USER);session_start();?>[/code]And the errors are here........[color=red]/opt/lampp/htdocs/askpert/publicWarning: session_start() [function.session-start]: open(/opt/lampp/htdocs/askpert/public/tmp/sessions/sess_b3654529b951ba4f34b61d78e9a19194, O_RDWR) failed: Permission denied (13) in /opt/lampp/htdocs/askpert/public/veeraa.php on line 28Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /opt/lampp/htdocs/askpert/public/veeraa.php:25) in /opt/lampp/htdocs/askpert/public/veeraa.php on line 28Warning: Unknown: open(/opt/lampp/htdocs/askpert/public/tmp/sessions/sess_b3654529b951ba4f34b61d78e9a19194, O_RDWR) failed: Permission denied (13) in Unknown on line 0Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/opt/lampp/htdocs/askpert/public/tmp/sessions) in Unknown on line 0[/color] Quote Link to comment https://forums.phpfreaks.com/topic/34970-session_start-problem/ Share on other sites More sharing options...
redbullmarky Posted January 20, 2007 Share Posted January 20, 2007 the first error is your problem. the others are a knock-on effect. Is it a server you have full access to? If so, you'll need to make sure the permissions on the sessions directory are set up correctly to allow the session files to be created.is there any reason why you need to set up a custom session save path? if not, remove/comment out this line:[code]<?phpsession_save_path(ROOT . DS . 'tmp' . DS . 'sessions');?>[/code]and try again Quote Link to comment https://forums.phpfreaks.com/topic/34970-session_start-problem/#findComment-164930 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.