Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

1. ## session variables

i used this function:
session_start();
Warning: Cannot send session cache limiter - headers already sent (output started at c:\program files\apache group\apache\htdocs\test\index.php:8) in c:\program files\apache group\apache\htdocs\test\index.php on line 38

Warning: open(/tmp\sess_2f20ae55ca19e33486cb9c946e0b2c97, O_RDWR) failed: m (2) in c:\program files\apache group\apache\htdocs\test\index.php on line 38

Warning: open(/tmp\sess_2f20ae55ca19e33486cb9c946e0b2c97, O_RDWR) failed: m (2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

what is the problem? and what is the solution?

• You cannot output anything at all to the browser before calling the session_start() function. So make sure you have don't have any extra lines or spaces that are being outputted to the browser before that line.

• you need to edit your php.ini to set the session.save_path directive to a directory that exists , say 'c:/windows/temp' or whatever , just make sure it exists

• Best advice: If your using php sessions on a page, the VERY FIRST TWO LINES should look like this:

PHP Code:
``` <?     session_start();     // Rest of code ```

• Originally Posted by zigo86
Best advice: If your using php sessions on a page, the VERY FIRST TWO LINES should look like this:

PHP Code:
``` <?     session_start();     // Rest of code ```
No. Your very first line should be
PHP Code:
``` <?php ```

• the output errors are probably due to the warnings created from the session write error , fix the session.save_path first , the other errors may then (or may not) go away.

• Originally Posted by firepages
you need to edit your php.ini to set the session.save_path directive to a directory that exists , say 'c:/windows/temp' or whatever , just make sure it exists
Wow how did I miss those other warnings they had posted? lol That's what I get for trying to answer a question at 6:30 in the morning.

•

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•