php-windows Digest 10 Oct 2007 19:29:06 -0000 Issue 3346

Topics (messages 28538 through 28545):

Re: Authentication Question!
        28538 by: Warren Vail
        28539 by: Gustav Wiberg

PHP-memory leak with COM-objects?
        28540 by: Gustav Wiberg
        28541 by: John Mertic
        28542 by: TG
        28543 by: Gustav Wiberg
        28544 by: John Mertic
        28545 by: Gustav Wiberg

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

Your statements are not entirely accurate, Cookies are stored IN files on
the client HD and can be stored there for a while, they don't do anything to
cause unspecified files to be stored as you seem to say.

PHP sessions employ a cookie to store the session key, which is tranmitted
with other data from the browser to the server, everytime a page from your
domain is requested.  At one time, not sure it still does, PHP used to add
the key to the URL in the event that cookies were disabled by the visitor.
Sessions allow you to store data on the server, and not send it to the
browser, and have that same data available with each page request.  If this
is sensitive data, like a customers identity, that is a good thing, sending
that information back and forth across the internet (as would be the case if
stored in a cookie) provides opportunities for sniffer to capture it.

If you use cookies for storing data on the visitors computer you might want
to consider encrypting the data, since it would be availabe to anyone who
gained access to his computer.  When you use PHP sessions, by default the
only thing stored on the visitors computer is the session key, but of
course, you are free to send other cookies.  The data elements you store in
a session are actually stored on your server where you can protect them, and
make the data persist at least as long as the session remains.  

A good way to learn about PHP session is to write database Session handler
routines and track how they are used, pay close attention to the garbage
cleanup routine which destroys old sessions.  You will have to write a set
of these routines if you have a high volume site with a load balancer in
front of your web server, because if you use the file storage technique that
comes with PHP, you may wind up storing your session data on one server and
with the next request the visitor could be directed to a different server
(you get the idea).

Probably more than you wanted to know,

Warren Vail

-----Original Message-----
From: Gustav Wiberg [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 09, 2007 11:23 PM
To: 'Matthew Gonzales'; 'PHP-Windows Group'
Subject: RE: [PHP-WIN] Authentication Question!

Hi!

For higher security it's generally better to use Sessions BECAUSE Cookies
generally stores files on the client hd for a longer time, and it's
therefore easier to get the password (if the password itself is not
encrypted). My tip is to use sessions if it works. Uses cookies in other
hand (It depends of the application what you need)

Best regards
/Gustav Wiberg
 

-----Original Message-----
From: Matthew Gonzales [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 09, 2007 8:23 PM
To: PHP-Windows Group
Subject: [PHP-WIN] Authentication Question!

Hello,

Could some one offer their opinion one which is better to use when creating
a password protected area, a $Cookie or a $Session. I have found alot of
info on both and can't really make up my mind. I am running PHP and MySQL on
IIS 6.0.

Matt G

--
Matthew Gonzales
IT Professional Specialist
Enterprise Information Technology Services University of Georgia
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Phone: (706)542-9538

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


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.5/1058 - Release Date: 2007-10-08
16:54
 

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

--- End Message ---
--- Begin Message ---
Hi!

I apologize.. Of course cookies are stored IN files. That was I meant.


Best regards
/Gustav Wiberg 
Ps. You should see what I meant, not what I typed ;-)


-----Original Message-----
From: Warren Vail [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 10, 2007 8:51 AM
To: 'Gustav Wiberg'; 'Matthew Gonzales'; 'PHP-Windows Group'
Subject: RE: [PHP-WIN] Authentication Question!

Gustav,

Your statements are not entirely accurate, Cookies are stored IN files on
the client HD and can be stored there for a while, they don't do anything to
cause unspecified files to be stored as you seem to say.

PHP sessions employ a cookie to store the session key, which is tranmitted
with other data from the browser to the server, everytime a page from your
domain is requested.  At one time, not sure it still does, PHP used to add
the key to the URL in the event that cookies were disabled by the visitor.
Sessions allow you to store data on the server, and not send it to the
browser, and have that same data available with each page request.  If this
is sensitive data, like a customers identity, that is a good thing, sending
that information back and forth across the internet (as would be the case if
stored in a cookie) provides opportunities for sniffer to capture it.

If you use cookies for storing data on the visitors computer you might want
to consider encrypting the data, since it would be availabe to anyone who
gained access to his computer.  When you use PHP sessions, by default the
only thing stored on the visitors computer is the session key, but of
course, you are free to send other cookies.  The data elements you store in
a session are actually stored on your server where you can protect them, and
make the data persist at least as long as the session remains.  

A good way to learn about PHP session is to write database Session handler
routines and track how they are used, pay close attention to the garbage
cleanup routine which destroys old sessions.  You will have to write a set
of these routines if you have a high volume site with a load balancer in
front of your web server, because if you use the file storage technique that
comes with PHP, you may wind up storing your session data on one server and
with the next request the visitor could be directed to a different server
(you get the idea).

Probably more than you wanted to know,

Warren Vail

-----Original Message-----
From: Gustav Wiberg [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 09, 2007 11:23 PM
To: 'Matthew Gonzales'; 'PHP-Windows Group'
Subject: RE: [PHP-WIN] Authentication Question!

Hi!

For higher security it's generally better to use Sessions BECAUSE Cookies
generally stores files on the client hd for a longer time, and it's
therefore easier to get the password (if the password itself is not
encrypted). My tip is to use sessions if it works. Uses cookies in other
hand (It depends of the application what you need)

Best regards
/Gustav Wiberg
 

-----Original Message-----
From: Matthew Gonzales [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 09, 2007 8:23 PM
To: PHP-Windows Group
Subject: [PHP-WIN] Authentication Question!

Hello,

Could some one offer their opinion one which is better to use when creating
a password protected area, a $Cookie or a $Session. I have found alot of
info on both and can't really make up my mind. I am running PHP and MySQL on
IIS 6.0.

Matt G

--
Matthew Gonzales
IT Professional Specialist
Enterprise Information Technology Services University of Georgia
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Phone: (706)542-9538

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


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.5/1058 - Release Date: 2007-10-08
16:54
 

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


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.6/1060 - Release Date: 2007-10-09 
16:43
 

--- End Message ---
--- Begin Message ---
Hi!
 
I want to use COM+ objects (especially with Word). I have understood (a lot of 
reading on the Internet) that when initiating COM-objects with Word (even if 
the object is released in variable in the code). Word leaks a lot of memory. I 
have also read that if I want to use Word-COM+ object I should have a dedicated 
server because it takes so much memory.
 
I have tested some and I easily get out of memory even if there is 4GB on the 
server I tested against. 
 
Then I run PHP as ISAPI, and the suggestion on the php.net site was to run PHP 
as CGI because COM-objects are run in the same memory-space as ISAPI when 
running as ISAPI-module. http://php.oregonstate.edu/manual/en/class.com.php
 
 
 
What do you guys thinks about above? Give me some feedback, please :-)
 
Best regards
/Gustav Wiberg
 

No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.488 / Virus Database: 269.14.6/1060 - Release Date: 2007-10-09 
16:43
 

--- End Message ---
--- Begin Message ---
I've worked a lot with the Word COM and while it works well on a
single desktop, I wouldn't recommend it for a server process. It's
rather slow and while the memory eventually gets cleaned up, it still
takes up a lot of memory for as little as it does. I'm not so sure
OpenOffice is much better in this regard.

You could push these tasks to another server, but I'd also look at
what you are doing and see if you can do it another way. We currently
use Word documents as template for a mail merge type operation and are
looking to move these to RTF since that enables us to take Word out of
the loop when doing the mail merge ( we actually just do a global find
and replace in the document since we've found more consistent results
with that ). But again, this all depends upon the application.

John

On 10/10/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
> Hi!
>
> I want to use COM+ objects (especially with Word). I have understood (a lot 
> of reading on the Internet) that when initiating COM-objects with Word (even 
> if the object is released in variable in the code). Word leaks a lot of 
> memory. I have also read that if I want to use Word-COM+ object I should have 
> a dedicated server because it takes so much memory.
>
> I have tested some and I easily get out of memory even if there is 4GB on the 
> server I tested against.
>
> Then I run PHP as ISAPI, and the suggestion on the php.net site was to run 
> PHP as CGI because COM-objects are run in the same memory-space as ISAPI when 
> running as ISAPI-module. http://php.oregonstate.edu/manual/en/class.com.php
>
>
>
> What do you guys thinks about above? Give me some feedback, please :-)
>
> Best regards
> /Gustav Wiberg
>
>
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.5.488 / Virus Database: 269.14.6/1060 - Release Date: 2007-10-09 
> 16:43
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
John Mertic
[EMAIL PROTECTED]
http://jmertic.wordpress.com

"Explaining a joke is like dissecting a frog: you understand it
better, but the frog dies
in the process." --Mark Twain

--- End Message ---
--- Begin Message ---
One thing to watch out for with using COM objects is to make sure you 
actually close the application when you're done using it and/or don't end 
up opening multiple instances of the application.

I can't remember what the exactly sequence was, but I think it was either 
Application.Exit() or Application.Quit()  (or both?).   I think the 
Application.Close() method just closes the document and not the application 
and.. again going on memory here... I believe the default state of the 
application was Visible = False, so you wouldn't even see that the 
application is still running unless you pulled up the Task Manager.

I don't know anything about memory leaks with this process, just know that 
this is one big "gotcha" that can eat up a ton of CPU and memory resources. 
 For me, COM is a last resort.  It's bulky and ugly and has a lot of 
potential for things like memory leaks and system instability in general.   
You might look to see if there's a PEAR package that can do what you want 
to do without using Word directly.

-TG

----- Original Message -----
From: Gustav Wiberg <[EMAIL PROTECTED]>
To: 'PHP-Windows Group' <[EMAIL PROTECTED]>
Date: Wed, 10 Oct 2007 09:36:00 +0200
Subject: [PHP-WIN] PHP-memory leak with COM-objects?

> Hi!
>  
> I want to use COM+ objects (especially with Word). I have understood (a lot 
> of reading on the Internet) that when initiating COM-objects with Word 
> (even if the object is released in variable in the code). Word leaks a 
> lot of memory. I have also read that if I want to use Word-COM+ object I 
> should have a dedicated server because it takes so much memory.
>  
> I have tested some and I easily get out of memory even if there is 4GB on 
> the server I tested against. 
>  
> Then I run PHP as ISAPI, and the suggestion on the php.net site was to run 
> PHP as CGI because COM-objects are run in the same memory-space as ISAPI 
> when running as ISAPI-module. 
> http://php.oregonstate.edu/manual/en/class.com.php
>  
>  
>  
> What do you guys thinks about above? Give me some feedback, please :-)
>  
> Best regards
> /Gustav Wiberg
>  
> 
> No virus found in this outgoing message.
> Checked by AVG Free Edition. 
> Version: 7.5.488 / Virus Database: 269.14.6/1060 - Release Date: 2007-10-09 
> 16:43
>  
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
Hi again!

I want the logged-in user to able to open a word-file (or an Excel-file or whatever) and then Push Save-Icon and make sure that changes are actually made.
Example:

John opens up file c:\test.doc. He writes "Ugly cow" in it and pushes the save-icon. Ugly Cow is now stored in file c:\test.doc. Working with COM-objects is the only solution I have found!?

Normally If John opens up c:\test.doc Internet Explorer (or whatever browser) saves the file temporarily in some temp-folder (don't know exact location), lets say c:\temp\sdifiuweoriu2734872.tmp. When John pushes Save-icon he saves the new information TO the temporarily stored file IF he doesn't use Save AS...

Please come with suggestions :-)

Best regards
/Gustav Wiberg

----- Original Message ----- From: "John Mertic" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP-Windows Group" <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2007 1:30 PM
Subject: Re: [PHP-WIN] PHP-memory leak with COM-objects?


I've worked a lot with the Word COM and while it works well on a
single desktop, I wouldn't recommend it for a server process. It's
rather slow and while the memory eventually gets cleaned up, it still
takes up a lot of memory for as little as it does. I'm not so sure
OpenOffice is much better in this regard.

You could push these tasks to another server, but I'd also look at
what you are doing and see if you can do it another way. We currently
use Word documents as template for a mail merge type operation and are
looking to move these to RTF since that enables us to take Word out of
the loop when doing the mail merge ( we actually just do a global find
and replace in the document since we've found more consistent results
with that ). But again, this all depends upon the application.

John

On 10/10/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
Hi!

I want to use COM+ objects (especially with Word). I have understood (a lot of reading on the Internet) that when initiating COM-objects with Word (even if the object is released in variable in the code). Word leaks a lot of memory. I have also read that if I want to use Word-COM+ object I should have a dedicated server because it takes so much memory.

I have tested some and I easily get out of memory even if there is 4GB on the server I tested against.

Then I run PHP as ISAPI, and the suggestion on the php.net site was to run PHP as CGI because COM-objects are run in the same memory-space as ISAPI when running as ISAPI-module. http://php.oregonstate.edu/manual/en/class.com.php



What do you guys thinks about above? Give me some feedback, please :-)

Best regards
/Gustav Wiberg


No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.488 / Virus Database: 269.14.6/1060 - Release Date: 2007-10-09 16:43


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




--
John Mertic
[EMAIL PROTECTED]
http://jmertic.wordpress.com

"Explaining a joke is like dissecting a frog: you understand it
better, but the frog dies
in the process." --Mark Twain

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



--- End Message ---
--- Begin Message ---
Is c:\test.doc a file on the local user's machine or the server?

On 10/10/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
> Hi again!
>
> I want the logged-in user to able to open a word-file (or an Excel-file or
> whatever) and then Push Save-Icon and make sure that changes are actually
> made.
> Example:
>
> John opens up file c:\test.doc. He writes "Ugly cow" in it and pushes the
> save-icon. Ugly Cow is now stored in file c:\test.doc. Working with
> COM-objects is the only solution I have found!?
>
> Normally If John opens up c:\test.doc Internet Explorer (or whatever
> browser) saves the file temporarily in some temp-folder (don't know exact
> location), lets say c:\temp\sdifiuweoriu2734872.tmp. When John pushes
> Save-icon he saves the new information TO the temporarily stored file IF he
> doesn't use Save AS...
>
> Please come with suggestions :-)
>
> Best regards
> /Gustav Wiberg
>
> ----- Original Message -----
> From: "John Mertic" <[EMAIL PROTECTED]>
> To: "Gustav Wiberg" <[EMAIL PROTECTED]>
> Cc: "PHP-Windows Group" <[EMAIL PROTECTED]>
> Sent: Wednesday, October 10, 2007 1:30 PM
> Subject: Re: [PHP-WIN] PHP-memory leak with COM-objects?
>
>
> > I've worked a lot with the Word COM and while it works well on a
> > single desktop, I wouldn't recommend it for a server process. It's
> > rather slow and while the memory eventually gets cleaned up, it still
> > takes up a lot of memory for as little as it does. I'm not so sure
> > OpenOffice is much better in this regard.
> >
> > You could push these tasks to another server, but I'd also look at
> > what you are doing and see if you can do it another way. We currently
> > use Word documents as template for a mail merge type operation and are
> > looking to move these to RTF since that enables us to take Word out of
> > the loop when doing the mail merge ( we actually just do a global find
> > and replace in the document since we've found more consistent results
> > with that ). But again, this all depends upon the application.
> >
> > John
> >
> > On 10/10/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
> >> Hi!
> >>
> >> I want to use COM+ objects (especially with Word). I have understood (a
> >> lot of reading on the Internet) that when initiating COM-objects with
> >> Word (even if the object is released in variable in the code). Word leaks
> >> a lot of memory. I have also read that if I want to use Word-COM+ object
> >> I should have a dedicated server because it takes so much memory.
> >>
> >> I have tested some and I easily get out of memory even if there is 4GB on
> >> the server I tested against.
> >>
> >> Then I run PHP as ISAPI, and the suggestion on the php.net site was to
> >> run PHP as CGI because COM-objects are run in the same memory-space as
> >> ISAPI when running as ISAPI-module.
> >> http://php.oregonstate.edu/manual/en/class.com.php
> >>
> >>
> >>
> >> What do you guys thinks about above? Give me some feedback, please :-)
> >>
> >> Best regards
> >> /Gustav Wiberg
> >>
> >>
> >> No virus found in this outgoing message.
> >> Checked by AVG Free Edition.
> >> Version: 7.5.488 / Virus Database: 269.14.6/1060 - Release Date:
> >> 2007-10-09 16:43
> >>
> >>
> >> --
> >> PHP Windows Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> > --
> > John Mertic
> > [EMAIL PROTECTED]
> > http://jmertic.wordpress.com
> >
> > "Explaining a joke is like dissecting a frog: you understand it
> > better, but the frog dies
> > in the process." --Mark Twain
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>


-- 
John Mertic
[EMAIL PROTECTED]
http://jmertic.wordpress.com

"Explaining a joke is like dissecting a frog: you understand it
better, but the frog dies
in the process." --Mark Twain

--- End Message ---
--- Begin Message ---
Hi!

It was just an example, but say Yes. Does it make a difference?

Best regards
/Gustav Wiberg

----- Original Message ----- From: "John Mertic" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP-Windows Group" <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2007 7:55 PM
Subject: Re: [PHP-WIN] PHP-memory leak with COM-objects?


Is c:\test.doc a file on the local user's machine or the server?

On 10/10/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
Hi again!

I want the logged-in user to able to open a word-file (or an Excel-file or
whatever) and then Push Save-Icon and make sure that changes are actually
made.
Example:

John opens up file c:\test.doc. He writes "Ugly cow" in it and pushes the
save-icon. Ugly Cow is now stored in file c:\test.doc. Working with
COM-objects is the only solution I have found!?

Normally If John opens up c:\test.doc Internet Explorer (or whatever
browser) saves the file temporarily in some temp-folder (don't know exact
location), lets say c:\temp\sdifiuweoriu2734872.tmp. When John pushes
Save-icon he saves the new information TO the temporarily stored file IF he
doesn't use Save AS...

Please come with suggestions :-)

Best regards
/Gustav Wiberg

----- Original Message -----
From: "John Mertic" <[EMAIL PROTECTED]>
To: "Gustav Wiberg" <[EMAIL PROTECTED]>
Cc: "PHP-Windows Group" <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2007 1:30 PM
Subject: Re: [PHP-WIN] PHP-memory leak with COM-objects?


> I've worked a lot with the Word COM and while it works well on a
> single desktop, I wouldn't recommend it for a server process. It's
> rather slow and while the memory eventually gets cleaned up, it still
> takes up a lot of memory for as little as it does. I'm not so sure
> OpenOffice is much better in this regard.
>
> You could push these tasks to another server, but I'd also look at
> what you are doing and see if you can do it another way. We currently
> use Word documents as template for a mail merge type operation and are
> looking to move these to RTF since that enables us to take Word out of
> the loop when doing the mail merge ( we actually just do a global find
> and replace in the document since we've found more consistent results
> with that ). But again, this all depends upon the application.
>
> John
>
> On 10/10/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
>> Hi!
>>
>> I want to use COM+ objects (especially with Word). I have understood >> (a
>> lot of reading on the Internet) that when initiating COM-objects with
>> Word (even if the object is released in variable in the code). Word >> leaks >> a lot of memory. I have also read that if I want to use Word-COM+ >> object
>> I should have a dedicated server because it takes so much memory.
>>
>> I have tested some and I easily get out of memory even if there is 4GB >> on
>> the server I tested against.
>>
>> Then I run PHP as ISAPI, and the suggestion on the php.net site was to
>> run PHP as CGI because COM-objects are run in the same memory-space as
>> ISAPI when running as ISAPI-module.
>> http://php.oregonstate.edu/manual/en/class.com.php
>>
>>
>>
>> What do you guys thinks about above? Give me some feedback, please :-)
>>
>> Best regards
>> /Gustav Wiberg
>>
>>
>> No virus found in this outgoing message.
>> Checked by AVG Free Edition.
>> Version: 7.5.488 / Virus Database: 269.14.6/1060 - Release Date:
>> 2007-10-09 16:43
>>
>>
>> --
>> PHP Windows Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
> --
> John Mertic
> [EMAIL PROTECTED]
> http://jmertic.wordpress.com
>
> "Explaining a joke is like dissecting a frog: you understand it
> better, but the frog dies
> in the process." --Mark Twain
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>





--
John Mertic
[EMAIL PROTECTED]
http://jmertic.wordpress.com

"Explaining a joke is like dissecting a frog: you understand it
better, but the frog dies
in the process." --Mark Twain

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



--- End Message ---

Reply via email to