At 2003-08-16 23:28 +0200, Peda wrote: >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"; >?> ><?php print( "Current User: $aUser >" ); print( "Current Account: $aAccount >" ); ?> > ><listing2.htm>Go to page 2 >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 > >It looks like I don't have permission to write in /tmp/ directory. >Can I change that permission?
Normally you can only change this when you're the system manager ('root'), but I'm looking now on the system that hosts one of my sites and there I seem to own the /tmp directory that I and my applications see. It's a kind of virtual private Unix server. When you have a shell login, try this: - cd /tmp - chown . <your_user_name> This probably gives an error warning. - chmod u+rw . This probably also gives an error warning. There are also permission commands under FTP I think. Otherwise contact your system manager. There are a lot of applications like 'vi' that don't work or don't work properly without read and write access to the /tmp directory. By the way, your second problem about not being able to send the cookies can be solved by putting ob_start(); as the first command in your PHP-file. Make sure you really insert this as the first command. You can't even output an empty line first for example in the HTML part (so outside of the <?php and ?>), also not in an include file. You can read much more about this in the manual under output buffering and the header() function etc. Greetings, Jaap -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php