session_start();Cookies

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
elias10
Forum Newbie
Posts: 4
Joined: Fri Nov 22, 2002 11:27 am

session_start();Cookies

Post by elias10 »

Hi,
I use win2000,apache and mysql.
I'm making a shop in my localhost.I have a problem with the variable session_start();
When i run the index.php i see the error messages


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

Warning: open(/tmp\sess_0d0265cae92fee731444d2a6e03b7f6f, 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
////////////////////////////////////////////////
The code of index.php is


<?
include ('book_sc_fns.php');
session_start();
do_html_header("Welcome to Book-O-Rama");

echo "<p>Please choose a category:</p>";

$cat_array = get_categories();

display_categories($cat_array);

if(session_is_registered("admin_user"))
{
display_button("admin.php", "admin-menu", "Admin Menu");
}

do_html_footer();
?>
THE FILE IS OK-SYNTAX IS OK
/////////////////////////////////////

I think the wrong is in the file php.ini in system32 folder of win2000.

What i must edit in that file in that lines(part of file php.ini)?


[Session]
session.save_handler = files ; handler used to store/retrieve data
session.save_path = /tmp ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
session.use_cookies = 1 ; whether to use cookies
session.name = PHPSESSID
; name of the session
; is used as cookie name
session.auto_start = 0 ; initialize session on request startup
session.cookie_lifetime = 0 ; lifetime in seconds of cookie
; or if 0, until browser is restarted
session.cookie_path = / ; the path the cookie is valid for
session.cookie_domain = ; the domain the cookie is valid for
session.serialize_handler = php ; handler used to serialize data
; php is the standard serializer of PHP
session.gc_probability = 1 ; percentual probability that the
; 'garbage collection' process is started
; on every session initialization
session.gc_maxlifetime = 1440 ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
session.referer_check = ; check HTTP Referer to invalidate
; externally stored URLs containing ids
session.entropy_length = 0 ; how many bytes to read from the file
session.entropy_file = ; specified here to create the session id
; session.entropy_length = 16
; session.entropy_file = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
; determine HTTP caching aspects
session.cache_expire = 180 ; document expires after n minutes
session.use_trans_sid = 1 ; use transient sid support if enabled
; by compiling with --enable-trans-sid
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"

/////////////////////////////////////////////////////////////////

The variable session.save_path = /tmp how i must edit it???
The files of my shop are in localhost->test->ptixiaki->index.php
The path of cookies for my computer is :
C:\Documents and Settings\Administrator\Cookies

Thank you
elias10
Forum Newbie
Posts: 4
Joined: Fri Nov 22, 2002 11:27 am

Post by elias10 »

ok,
i edit the php.ini file
session.save_path = c:/winnt/temp;

I restarted apache web server and i hava again thios error msg
Warning: open(/tmp\sess_0d0265cae92fee731444d2a6e03b7f6f, O_RDWR) failed: m (2) in c:\program files\apache group\apache\htdocs\test\ptixiaki\index.php on line 4
Why the folder tmp didn;t change?
I changed it in the php.ini to c:/winnt/temp;

i run phpinfo() and the variable session.save_path
is /tmp

But the in the php.ini file i changed it to session.save_path = c:/winnt/temp

I must restart the pc?????

I use win2000 mysql and apache

WHY
serg4444
Forum Newbie
Posts: 9
Joined: Fri Nov 22, 2002 10:27 am

Post by serg4444 »

Change access rules to folder where you want store your info

Sincerely,
Sergey Booyny
AlarIT programmer
http://www.AlarIT.com
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

If PHP is running as an Apache module then you need to restart Apache to get it to register the changes - you don't need to restart the entire computer.

Mac
Post Reply