php-general Digest 19 Oct 2003 01:31:31 -0000 Issue 2363

Topics (messages 166616 through 166630):

Re: SESSION Not behaving II: permission denied(13)
        166616 by: James Kaufman
        166624 by: [-^-!-%-
        166625 by: Duncan Hill
        166626 by: Javier Muniz
        166627 by: Javier Muniz

Re: Filemanager v1.0
        166617 by: Becoming Digital

Loop Question
        166618 by: Jed R. Brubaker
        166619 by: Robert Cummings
        166620 by: Jed R. Brubaker

Re: Using two XSLT stylesheets
        166621 by: Ray Hunter
        166629 by: rich

Dealing with session expiry
        166622 by: Radek Zajkowski
        166623 by: Zilvinas

Re: best way to use session vars?
        166628 by: Curt Zirzow

4.3.1 for Debian Woody?
        166630 by: Joel Konkle-Parker

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
On Sat, Oct 18, 2003 at 03:44:31PM +0300, Burhan Khalid wrote:
> [-^-!-%- wrote:
> >Yep. It's me again. 96 hours into the battle, and SESSIONS are still
> >winning.
> >
> >I've written my login script and is now getting the following error.
> >Please advise.
> >
> >Warning: open(/tmp/sess_a690c089dead297c95034d9fe243f860, O_RDWR) failed:
> >Permission denied (13) 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
> 
> First thing, make sure /tmp exists.
> If it does, make sure that the apache user has permissions to write to 
> it. You can modify its permissions so that the apache user and/or group 
> can write to /tmp; or you can chmod it to 777 (which could lead to other 
> security issues).
> 
> This should get rid of your warnings.
> 
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
> 

The standard permissions for /tmp are 1777. This allows any user to write to
tmp, but only the user who created a specific file (eg, the session file as
apache) can delete the file. Further, sesssions are created with a very
restrictive permission set, so that ony the apache user and root will be able
to read the data.

Bottom line: make sure that /tmp exists and that its permissions are 1777. (as
root, chmod 1777 /tmp)

-- 
Jim Kaufman             mailto:[EMAIL PROTECTED]
Linux Evangelist        cell: 612-481-9778              
public key 0x6D802619   fax:  952-937-9832
http://www.linuxforbusiness.net

--- End Message ---
--- Begin Message ---

That would be one solution, but I am on a shared hosting server. I cannot
change the folder permissions.

I've asked tech support to look into this.

Does anyone know where I can get a class that will save the session vars
to mysql?





=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.

On Sat, 18 Oct 2003, Burhan Khalid wrote:

> [-^-!-%- wrote:
> > Yep. It's me again. 96 hours into the battle, and SESSIONS are still
> > winning.
> >
> > I've written my login script and is now getting the following error.
> > Please advise.
> >
> > Warning: open(/tmp/sess_a690c089dead297c95034d9fe243f860, O_RDWR) failed:
> > Permission denied (13) 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
>
> First thing, make sure /tmp exists.
> If it does, make sure that the apache user has permissions to write to
> it. You can modify its permissions so that the apache user and/or group
> can write to /tmp; or you can chmod it to 777 (which could lead to other
> security issues).
>
> This should get rid of your warnings.
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
>

--- End Message ---
--- Begin Message ---
>
>
> That would be one solution, but I am on a shared hosting server. I cannot
> change the folder permissions.
>
> I've asked tech support to look into this.
>
> Does anyone know where I can get a class that will save the session vars
> to mysql?

I ended up modifying the example of a postgres handler to work in mysql.  I
haven't validated it for heavy usage though, nor whether the garbage
collection works properly.  More than willing to share if you want it... oh,
and it isn't a class.

--- End Message ---
--- Begin Message ---
Look at on_session_save_handler in the manual, I believe there is an example
there on how to do this.  If not google it, many examples of this exist...
So many that I don't think it's worth spamming this list with my own
examples.

-Javier

-----Original Message-----
From: [-^-!-%- [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 18, 2003 2:35 PM
To: Burhan Khalid
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] SESSION Not behaving II: permission denied(13)




That would be one solution, but I am on a shared hosting server. I cannot
change the folder permissions.

I've asked tech support to look into this.

Does anyone know where I can get a class that will save the session vars to
mysql?





=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.

On Sat, 18 Oct 2003, Burhan Khalid wrote:

> [-^-!-%- wrote:
> > Yep. It's me again. 96 hours into the battle, and SESSIONS are still 
> > winning.
> >
> > I've written my login script and is now getting the following error. 
> > Please advise.
> >
> > Warning: open(/tmp/sess_a690c089dead297c95034d9fe243f860, O_RDWR) 
> > failed: Permission denied (13) 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
>
> First thing, make sure /tmp exists.
> If it does, make sure that the apache user has permissions to write to 
> it. You can modify its permissions so that the apache user and/or 
> group can write to /tmp; or you can chmod it to 777 (which could lead 
> to other security issues).
>
> This should get rid of your warnings.
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
>

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

--- End Message ---
--- Begin Message ---
Err, make that session_set_save_handler :)

-----Original Message-----
From: Javier Muniz [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 18, 2003 4:27 PM
To: [EMAIL PROTECTED]
Subject: RE: [PHP] SESSION Not behaving II: permission denied(13)


Look at on_session_save_handler in the manual, I believe there is an example
there on how to do this.  If not google it, many examples of this exist...
So many that I don't think it's worth spamming this list with my own
examples.

-Javier

-----Original Message-----
From: [-^-!-%- [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 18, 2003 2:35 PM
To: Burhan Khalid
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] SESSION Not behaving II: permission denied(13)




That would be one solution, but I am on a shared hosting server. I cannot
change the folder permissions.

I've asked tech support to look into this.

Does anyone know where I can get a class that will save the session vars to
mysql?





=P e p i e  D e s i g n s
 www.pepiedesigns.com
 Providing Solutions That Increase Productivity

 Web Developement. Database. Hosting. Multimedia.

On Sat, 18 Oct 2003, Burhan Khalid wrote:

> [-^-!-%- wrote:
> > Yep. It's me again. 96 hours into the battle, and SESSIONS are still
> > winning.
> >
> > I've written my login script and is now getting the following error.
> > Please advise.
> >
> > Warning: open(/tmp/sess_a690c089dead297c95034d9fe243f860, O_RDWR)
> > failed: Permission denied (13) 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
>
> First thing, make sure /tmp exists.
> If it does, make sure that the apache user has permissions to write to
> it. You can modify its permissions so that the apache user and/or 
> group can write to /tmp; or you can chmod it to 777 (which could lead 
> to other security issues).
>
> This should get rid of your warnings.
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
> http://www.meidomus.com
>

-- 
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

--- End Message ---
--- Begin Message ---
> This John H guy sounds like a dick. Someone should boot him.

He can't help it.  After all, he is military...

Edward Dudlik
"Those who say it cannot be done
should not interrupt the person doing it."

wishy washy | www.amazon.com/o/registry/EGDXEBBWTYUU



----- Original Message ----- 
From: "CPT John W. Holmes" <[EMAIL PROTECTED]>
To: "Ryan A" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, 17 October, 2003 15:49
Subject: Re: [PHP] Filemanager v1.0


From: "Ryan A" <[EMAIL PROTECTED]>

> and another thing, don't ask John H  for help (or sarcastic comments)...
> that too is reserved just for me.
> You have been warned....

This John H guy sounds like a dick. Someone should boot him.

---John Holmes...

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

--- End Message ---
--- Begin Message ---
Hi! I am trying to loop through two different database calls with two for
statements, one embedded in the other.

       for ($i; $i < $codeset_rows; $i++)
        {
            $codeset_row = $this->database->fetch_array($codeset_query);
            $codesys_query = $this->database->query("select
codesys.codesys_index,

codesys.code_name,

codesys.code_value

from   codesys

where  codesys.codeset_ID = ".$codeset_row['codeset_ID']);

            $codesys_rows = $this->database->num_rows($codesys_query);

            for ($j; $j < $codesys_rows; $j++)
            {
                echo "Blah, blah, blah....";
            }

        }

The current set up means that the first loop should cycle twice, and the
second loop should cycle 6 times the first time and 2 times the second.

So here is the question: $j doesn't unset when the loop ends. So when it
comes around the second time, $j still = 6 and since $codesys_rows = 2, it
skips the loop. I can fix this by putting an
if ($j)
    {unset($j);}
right before the second loop. However, it seems that there should be some
more efficient way to do this.
Ideas?

Thanks!

--- End Message ---
--- Begin Message ---
See changes below.

Cheers,
Rob.

On Sat, 2003-10-18 at 14:57, Jed R. Brubaker wrote:
> Hi! I am trying to loop through two different database calls with two for
> statements, one embedded in the other.
> 
>        for ($i; $i < $codeset_rows; $i++)

         for ($i = 0; $i < $codeset_rows; $i++)

>         {
>             $codeset_row = $this->database->fetch_array($codeset_query);
>             $codesys_query = $this->database->query("select
> codesys.codesys_index,
> 
> codesys.code_name,
> 
> codesys.code_value
> 
> from   codesys
> 
> where  codesys.codeset_ID = ".$codeset_row['codeset_ID']);
> 
>             $codesys_rows = $this->database->num_rows($codesys_query);
> 
>             for ($j; $j < $codesys_rows; $j++)

              for ($j = 0; $j < $codesys_rows; $j++)

>             {
>                 echo "Blah, blah, blah....";
>             }
> 
>         }
> 
> The current set up means that the first loop should cycle twice, and the
> second loop should cycle 6 times the first time and 2 times the second.
> 
> So here is the question: $j doesn't unset when the loop ends. So when it
> comes around the second time, $j still = 6 and since $codesys_rows = 2, it
> skips the loop. I can fix this by putting an
> if ($j)
>     {unset($j);}
> right before the second loop. However, it seems that there should be some
> more efficient way to do this.
> Ideas?
> 
> Thanks!
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
Well duh. Thanks so much!

"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> See changes below.
>
> Cheers,
> Rob.
>
> On Sat, 2003-10-18 at 14:57, Jed R. Brubaker wrote:
> > Hi! I am trying to loop through two different database calls with two
for
> > statements, one embedded in the other.
> >
> >        for ($i; $i < $codeset_rows; $i++)
>
>          for ($i = 0; $i < $codeset_rows; $i++)
>
> >         {
> >             $codeset_row = $this->database->fetch_array($codeset_query);
> >             $codesys_query = $this->database->query("select
> > codesys.codesys_index,
> >
> > codesys.code_name,
> >
> > codesys.code_value
> >
> > from   codesys
> >
> > where  codesys.codeset_ID = ".$codeset_row['codeset_ID']);
> >
> >             $codesys_rows = $this->database->num_rows($codesys_query);
> >
> >             for ($j; $j < $codesys_rows; $j++)
>
>               for ($j = 0; $j < $codesys_rows; $j++)
>
> >             {
> >                 echo "Blah, blah, blah....";
> >             }
> >
> >         }
> >
> > The current set up means that the first loop should cycle twice, and the
> > second loop should cycle 6 times the first time and 2 times the second.
> >
> > So here is the question: $j doesn't unset when the loop ends. So when it
> > comes around the second time, $j still = 6 and since $codesys_rows = 2,
it
> > skips the loop. I can fix this by putting an
> > if ($j)
> >     {unset($j);}
> > right before the second loop. However, it seems that there should be
some
> > more efficient way to do this.
> > Ideas?
> >
> > Thanks!
> >
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> -- 
> .------------------------------------------------------------.
> | InterJinn Application Framework - http://www.interjinn.com |
> :------------------------------------------------------------:
> | An application and templating framework for PHP. Boasting  |
> | a powerful, scalable system for accessing system services  |
> | such as forms, properties, sessions, and caches. InterJinn |
> | also provides an extremely flexible architecture for       |
> | creating re-usable components quickly and easily.          |
> `------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
> xslt_process($xh, 'library.xml', 'simple-search-get-results.xsl',
>  --> 'results.xml', NULL, $params);
> $data = xslt_process($xh, 'results.xml',
>  --> 'simple-search-display-results.xsl', NULL, NULL, NULL);


What happens when you do the above...what is the var_dump of data?

--
BigDog

--- End Message ---
--- Begin Message ---
Ray Hunter wrote:

> 
>> xslt_process($xh, 'library.xml', 'simple-search-get-results.xsl',
>>  --> 'results.xml', NULL, $params);
>> $data = xslt_process($xh, 'results.xml',
>>  --> 'simple-search-display-results.xsl', NULL, NULL, NULL);
> 
> 
> What happens when you do the above...what is the var_dump of data?
> 
> --
> BigDog

I get this:
Warning: Sablotron error on line 1001: cannot open file
'/var/www/html/cdlib/search/results.xml' in
/var/www/html/cdlib/search/simple-search.php on line 24
 string(591) " " 

line 24 is the first call to xslt_process() above.

But I'd never tried using var_dump($data) before. It appears the the
second call is working fine: the file 'results.xml' exists already
becasue I've been using a command line XSL processor to test the
stylesheets. The second call to xslt_process() appears to have read
and processed the data which was in that file correctly because
var_dump() has inserted the result into the HTML following the error
message.
-- 
Richard
UEA/MUS::Record Library

--- End Message ---
--- Begin Message ---
I have some pages that use sessions to call out certain elements in the
layouts. It allows user to decide how should their pages look for the
duration of their visit.

Unfortunately whenever a user leaves their browser idle past the expity time
of the session on their next click pages fall apart and all styles etc. are
lost.

I understand that I can detect or at least anticipate expiry of the session
and renew it before it does. The question is how?

Thanks in advance

R>

--- End Message ---
--- Begin Message ---
Hello,

Why are you saving such information into a session? Sessions are for temporary 
information. Use cookies or database, if you are doing what you are saying :) There 
should be no harm.

Bye.

> I have some pages that use sessions to call out certain elements in the
> layouts. It allows user to decide how should their pages look for the
> duration of their visit.
> 
> Unfortunately whenever a user leaves their browser idle past the expity time
> of the session on their next click pages fall apart and all styles etc. are
> lost.
> 
> I understand that I can detect or at least anticipate expiry of the session
> and renew it before it does. The question is how?
> 
> Thanks in advance
> 
> R>
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
* Thus wrote David T-G ([EMAIL PROTECTED]):
> Hi, all --
> 
> Well, now that I have to change my code around, I suppose I should learn
> the best way, if there is one in particular, to manage sessions.
> 
> Should I use $_SESSION for everything or should I use session_start and
> session_register and friends instead?  Is there a clear win with either
> one?

$_SESSION is the proper way to do it (with globals off), you will still need to call
session_start() on each page.



Curt
-- 
"My PHP key is worn out"

  PHP List stats since 1997: 
          http://zirzow.dyndns.org/html/mlists/

--- End Message ---
--- Begin Message --- Does anyone have, or know where to get, a Debian Woody package for PHP 4.3.1? I've checked apt-get.org, but nobody seems to have that version.

Thanks in advance.


-- Joel Konkle-Parker Webmaster [Ballsome.com]

Phone     [+1 662-518-1636]
E-mail    [EMAIL PROTECTED]

--- End Message ---

Reply via email to