For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > September 2007 > session_start problem in php5









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author session_start problem in php5
Jannis

2007-09-16, 4:16 am

Some of my php files start with <?php session_start(); ?>
Up to recently this was no problem. Recently my provider upgraded from
php4 to php5. From then I get this message:

Warning: session_start() [function.session-start]: SAFE MODE
Restriction in effect. The script whose uid is 522 is not allowed to
access owned by uid 0 in (...path..)/starttest.php on line 1

Fatal error: session_start() [<a
href='function.session-start'>function.session-start</a>]: Failed to
initialize storage module: files (path: ) in (..path..)/starttest.php
on line 1.

It doesn't matter whether I use notepad or some editor, or copy a file
from php.net . Actually the example here mentioned was written in
notepad.

Is this a bug? Do I overlook something? What can be wrong?
J.O. Aho

2007-09-16, 4:16 am

Jannis wrote:
> Some of my php files start with <?php session_start(); ?>
> Up to recently this was no problem. Recently my provider upgraded from
> php4 to php5. From then I get this message:
>
> Warning: session_start() [function.session-start]: SAFE MODE
> Restriction in effect. The script whose uid is 522 is not allowed to
> access owned by uid 0 in (...path..)/starttest.php on line 1


It seems like the directory where the session data is stored isn't accessible
by the server (apache, I would guess) as it's not run as root (thats good they
don't).

This has nothing to do with how you write the session, but how the web hotel
has increased security.

If you are lucky, you may setup your own php rules in the .htaccess, then you
could add the following:

php_admin_flag safe_mode off
php_admin_value upload_tmp_dir "/tmp"
php_admin_value session.save_path "/tmp"

I suggest you talk with the support team at your web hotel and ask the advice
how to get the session to work in their improved security environment.



--

//Aho
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com