php-windows Digest 11 Oct 2007 11:06:40 -0000 Issue 3347
Topics (messages 28546 through 28555):
Re: PHP-memory leak with COM-objects?
28546 by: John Mertic
28547 by: Gustav Wiberg
Reading files from Win 2003 Server
28548 by: Alexis
28554 by: Gustav Wiberg
28555 by: John Mertic
Permissions on Server 2003
28549 by: Alexis
28550 by: Gustav Wiberg
28552 by: Jeff White
Ajax and PHP
28551 by: Matthew Gonzales
28553 by: Jeff White
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 ---
Using PHP ( whether via COM or not ) in a web application to interact
with a file on the local user's machine isn't possible. PHP is a
server-side language in this context, and it interacts with the COM
object on the server which has no access to the user's local machine.
If the file is on the server, you can't push changes to it from the
Word editing control in IE, it will only allow saving changes to the
local computer.
If you are looking at doing the first option, then a PHP web app is
out of the question; perhaps a short VBScript to do any preprocessing
of the document would be in order. If you are looking at the second,
you may want to consider one of the Rich Text Editing tools that you
can drop in a webpage, such as FCKEditor or TinyMCE; these typically
will want input and output in XHTML however.
John
On 10/10/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
> 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
> >
> >
>
>
>
--
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 again!
I noticed I didn't pay enough attention to your question... Sorry for that.
The file is stored on the server!
And with COM-objects I managed to do a PHP-script - create a
(Word)-COM-object to open a certain file (say c:\test.doc on the server). I
changed te c:\test.doc from within the php-application and pushed Saved (in
the Word-object that open up). And Yes, the content changed in the file
c:\test.doc which is on the server.
TinyMCE or whatsoever is out of question. It must be word. I don't want to
change a whole organisations policy about using word... :-)
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 10:07 PM
Subject: Re: [PHP-WIN] PHP-memory leak with COM-objects?
Using PHP ( whether via COM or not ) in a web application to interact
with a file on the local user's machine isn't possible. PHP is a
server-side language in this context, and it interacts with the COM
object on the server which has no access to the user's local machine.
If the file is on the server, you can't push changes to it from the
Word editing control in IE, it will only allow saving changes to the
local computer.
If you are looking at doing the first option, then a PHP web app is
out of the question; perhaps a short VBScript to do any preprocessing
of the document would be in order. If you are looking at the second,
you may want to consider one of the Rich Text Editing tools that you
can drop in a webpage, such as FCKEditor or TinyMCE; these typically
will want input and output in XHTML however.
John
On 10/10/07, Gustav Wiberg <[EMAIL PROTECTED]> wrote:
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
>
>
--
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 ---
Hi,
I know this may not be relevant to this list but I tried the General
list and got no reply.
I have a script located on an Ubuntu box and I am trying to read
files located on a Win 2003 Server.
I have 'mounted', if that's the right term to use, a connection from
Ubuntu to Server 2003 and can read the files fine via the desktop, etc.
If the Win Server name is say 'WinServer' and the shared directory I
want to read from on it is called say 'SharedDirectory' and the user
name is 'User', I notice the reference to that folder on the Ubuntu
desktop is as follows:
smb://[EMAIL PROTECTED]/SharedDirectory
But I am at a loss as to how I should refer to the path for this
connection within my PHP script. Any help would be most appreciated.
If it's any additional help, I would be using the connection to read
files only, and not add/edit/delete them.
Thanks
Alexis
--- End Message ---
--- Begin Message ---
Hi!
I haven't managed to use UNC-pat \\SERVER\computer... etc...
with PHP
But it's might be possible to do some network-mapping - a letter with the
directory? and then access the mapping-letter through PHP?
Best regards
/Gustav Wiberg
----- Original Message -----
From: "Alexis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2007 10:57 PM
Subject: [PHP-WIN] Reading files from Win 2003 Server
Hi,
I know this may not be relevant to this list but I tried the General list
and got no reply.
I have a script located on an Ubuntu box and I am trying to read
files located on a Win 2003 Server.
I have 'mounted', if that's the right term to use, a connection from
Ubuntu to Server 2003 and can read the files fine via the desktop, etc.
If the Win Server name is say 'WinServer' and the shared directory I
want to read from on it is called say 'SharedDirectory' and the user
name is 'User', I notice the reference to that folder on the Ubuntu
desktop is as follows:
smb://[EMAIL PROTECTED]/SharedDirectory
But I am at a loss as to how I should refer to the path for this
connection within my PHP script. Any help would be most appreciated.
If it's any additional help, I would be using the connection to read
files only, and not add/edit/delete them.
Thanks
Alexis
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
You're going to want to mount the directory at the command line, something like
smbmount //server/share /localdir -o username=user,password=pass,uid=500,gid=500
Also be sure that /localdir is readable by the www-user account.
John
On 10/10/07, Alexis <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I know this may not be relevant to this list but I tried the General
> list and got no reply.
>
> I have a script located on an Ubuntu box and I am trying to read
> files located on a Win 2003 Server.
>
> I have 'mounted', if that's the right term to use, a connection from
> Ubuntu to Server 2003 and can read the files fine via the desktop, etc.
>
> If the Win Server name is say 'WinServer' and the shared directory I
> want to read from on it is called say 'SharedDirectory' and the user
> name is 'User', I notice the reference to that folder on the Ubuntu
> desktop is as follows:
>
> smb://[EMAIL PROTECTED]/SharedDirectory
>
>
>
> But I am at a loss as to how I should refer to the path for this
> connection within my PHP script. Any help would be most appreciated.
>
> If it's any additional help, I would be using the connection to read
> files only, and not add/edit/delete them.
>
> Thanks
> Alexis
>
> --
> 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,
I am trying to read the contents of a directory on a Server 2003 network.
I have removed the 'General Users' from the set of permissions on the
directory, as only the owner of the directory is allowed to access it.
In this case myself.
Now by doing this I am obviously stopping PHP scripts from accessing
this directory. How can I get around this? Can I pass the Username and
password through the scripting, or do I need to set up a new user group
and assign it to the PHP scripts as it were. In either case how would I
go about doing it?
TIA
Alexis
--- End Message ---
--- Begin Message ---
Hi Alexis!
As default there is two users assigned as anynomous users for Internet. the
default is IUSR_<name of server> (and there is also IWAM_ but this is more
for service-processing than administration of rights)
Set the permissions of this user to read in the directory you want to read
content from.
Best regards
/Gustav Wiberg
----- Original Message -----
From: "Alexis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 10, 2007 11:01 PM
Subject: [PHP-WIN] Permissions on Server 2003
Hi,
I am trying to read the contents of a directory on a Server 2003 network.
I have removed the 'General Users' from the set of permissions on the
directory, as only the owner of the directory is allowed to access it. In
this case myself.
Now by doing this I am obviously stopping PHP scripts from accessing this
directory. How can I get around this? Can I pass the Username and password
through the scripting, or do I need to set up a new user group and assign
it to the PHP scripts as it were. In either case how would I go about
doing it?
TIA
Alexis
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hello Alexis,
I use PHP on our LAN at work using Windows authentication. If you want to
restrict HTTP access to the directory using Windows permissions you'll have
to:
1. Uncheck the Anonymous user authentication in IIS (in IIS 5.1: site
properties > "Directory Security" > "Anonymous access and authentication
control" > "Edit").
2. Check "Integrated Windows Authentication" in the lower part of the
dialog. That will allow users to run the PHP script in the security context
of their username.
3. Set permissions on the folder or files to whomever's account or groups
you wish.
4. Use the Windows domain name account (username only, no passwords) in PHP
for authentication to the folders/files possibly using a (My)SQL database or
(maybe) through LDAP. I can't confirm the LDAP method as I've not had much
success using Active Directory with PHP, but only read of it.
I hope this helps your situation.
Jw
-----Original Message-----
From: Alexis [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 10, 2007 5:02 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Permissions on Server 2003
Hi,
I am trying to read the contents of a directory on a Server 2003 network.
I have removed the 'General Users' from the set of permissions on the
directory, as only the owner of the directory is allowed to access it.
In this case myself.
Now by doing this I am obviously stopping PHP scripts from accessing
this directory. How can I get around this? Can I pass the Username and
password through the scripting, or do I need to set up a new user group
and assign it to the PHP scripts as it were. In either case how would I
go about doing it?
TIA
Alexis
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Has anyone out there conquered Ajax and PHP? Do you recommend any books
or websites that provide good tutorials? Thanks!
Matt
--
Matthew Gonzales
IT Professional Specialist
Enterprise Information Technology Services
University of Georgia
Email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Phone: (706)542-9538
--- End Message ---
--- Begin Message ---
Hello Matt,
I read this book and reference it often:
"AJAX and PHP: Building Responsive Web Applications"
Packt Publishing - 2006 ( http://www.packtpub.com )
ISBN 1-904811-82-5
As far as sites to check, I have used Prototype
( http://www.prototypejs.org/ ) more than anything else. There is somewhat
of a learning curve depending on your level of expertise, but after you get
the hang of it, you'll probably love using it.
Just my 2ยข worth. Hope it helps...
JW
-----Original Message-----
From: Matthew Gonzales [mailto:[EMAIL PROTECTED]
Sent: Wednesday, October 10, 2007 5:41 PM
To: PHP-Windows Group
Subject: [PHP-WIN] Ajax and PHP
Has anyone out there conquered Ajax and PHP? Do you recommend any books
or websites that provide good tutorials? Thanks!
Matt
--
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
--- End Message ---