As others have pointed out already, your problem indeed is about not being
able to write in the tmp directory. Also, as others have pointed out, if
it's not your server you would not be able to change file permissions of the
/tmp directory. Your solution is probably found in changing the path where
php saves session data.

        ini_set('session.save_path', '/full/path/to/your/own/tmp/directory');

Of course you change the path to your own path. That would solve it for the
scripts you have that command in. If the settings of the webserver you're
running on allow it, you'd probably better use a ".htaccess" file in the
folder your php scripts run from (or just the htdocs folder, to have it
applied to all dirs). This file would then contain at least:

        php_value       session.save_path       "/full/path/to/your/own/tmp/directory"

That would also solve your problem.

The other error is also indeed about output being sent before setting a
cookie. You can use ob_start() to get rid if it. But I won't do that. It
just creates overhead, makes your scripts heavier.. As you probably would
have guessed, this time the Warning rose because your script outputted some
other error message, which makes your script also output it's headers. When
you get rid of that first warning, the others will be gone too.

Let me know if it helped you !

Wouter

-----Oorspronkelijk bericht-----
Van: Peda [mailto:[EMAIL PROTECTED]
Verzonden: zaterdag 16 augustus 2003 23:29
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Sessions


Hi!!

I have some problem on my site.

When I'm using this PHP script:

<?php
    session_start();
    session_register( "aUser", "aAccount" );
    $aUser      = "Cidnie";
    $aAccount   = "1016";
?>
<html>
<head>
 <title>Getting Started With Sessions: Page 1</title>
</head>
<body>
<?php
    print( "Current User: $aUser<br>" );
    print( "Current Account: $aAccount<br>" );
?>
    <br><br>
    <a href="listing2.phtml">Go to page 2</a>
</body>
</html>

I'm getting this warning messages:

Warning: session_start(): open(/tmp/sess_cbd07ca5b53347ca5003404053754bde,
O_RDWR) failed: Permission denied (13) in
/home2/pena/public_html/listing1.php on line 2

Warning: session_start(): Cannot send session cookie - headers already sent
by (output started at /home2/pena/public_html/listing1.php:2) in
/home2/pena/public_html/listing1.php on line 2

Warning: session_start(): Cannot send session cache limiter - headers
already sent (output started at /home2/pena/public_html/listing1.php:2) in
/home2/pena/public_html/listing1.php on line 2

Warning: Unknown(): open(/tmp/sess_cbd07ca5b53347ca5003404053754bde, O_RDWR)
failed: Permission denied (13) in Unknown on line 0

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


It looks like I don't have permission to write in /tmp/ directory.
Can I change that permission?

Greetings, Peda!!!



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to