php-windows Digest 19 Sep 2002 04:33:12 -0000 Issue 1346

Topics (messages 15886 through 15899):

Re: error from PHP...any ideas?
        15886 by: Brian 'Bex' Huff

Re: Calling DLL from PHP
        15887 by: Brian 'Bex' Huff

Re: redirection help
        15888 by: Brian 'Bex' Huff

Re: SESSIONS- clustered environment
        15889 by: Matt Babineau
        15890 by: Luis Ferro
        15891 by: dash php

Help!
        15892 by: Lanham Rattan

php.ini pr. site
        15893 by: Steen Rabol
        15894 by: David Hollister

Inserting text with single quotes into database
        15895 by: Lanham Rattan
        15896 by: dash php
        15897 by: Rich Gray

Simultaneous system(), passthru()... commands. HELP PLEASE !!!
        15898 by: Jean-Marc Godart

uploading pics
        15899 by: SEGUERRA FRANCIS TED ARANAS

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

Haven't seen that one... I have seen similar access violations in the 
same environment, however:

php4ts!zend_strndup + 0x2B + 0xA05CB1AD

Which is really really odd, since the C code for that function is pretty 
dang innocent looking... Ive been trying to get a stack trace on this 
one for a few weeks now, but once I installed a debugger on that system, 
the problem went away.  grrrr!

Running PHP as a CGI module seems to fix all the problems, as far as I 
can tell.

-- 

Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424

> IIS 5, Win2K, Running as ISAPI, HTTPS, PHP 4.2
>  
> PHP has encountered an Access Violation at 01152A55
>  
> Any ideas how to deal with this? I got this on my development server.
> Should I just use PHP as a CGI instead of ISAPI?
>  
>  
>  
> Matt Babineau
> MCWD / CCFD



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

If your program is called "myprogram.exe", and it has a command-line 
interface that you've tested and works, then you could do this:

1) put "myprogram.exe" in your system path (typically c:\winnt\system32 
or something similar)

2) call it from your php code with either exec(), system(), or passthru()

http://www.php.net/manual/it/ref.exec.php
http://www.php.net/manual/it/function.system.php
http://www.php.net/manual/it/function.passthru.php

-- 

Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424

> Brian hanks for all and sorry if I trouble you again.
> 
> I ask a litle help if you wnat and if you have time for me.
> 
> thanks for this and sorry again for the trouble.
> 
> I want use a external pgm (.exe file) from my script PHP.
> 
> My env it it Win32 NT Apache 1.3.24 and PHP 4.2.1.
> 
> I have find same sample but ONLY in the Linux or Unix system. Not in
> Win32.
> 
> I have try to execute same sample in my env but It do not work.
> 
> I ask you if you have same code and same sample for me.
> 
> Have  you same idea how to do.
> 
> thanks for all. Ciao franco.
> 


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

There is another option... set 'output_buffering' to some number of 
bytes (around 4000 is probably ok) in your php.ini file.

This will buffer the page in PHP before being sent to the client, so 
things like cookies and headers can be set early-ish in the page, and 
dont absolutely have to go on the first line of PHP code.

The docs state that this will slow down PHP slightly, but Im not quite 
convinced.  A small amount of buffering is a good thing, especially when 
dealing with resources that have a bit of overhead, like TCP sockets or 
filesystems.  That way, if you have a 10000 line HTML page, instead of 
possibly doing 10000 socket write calls, you only do a handful.  And RAM 
is way cheap these days  ;)

-- 

Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424

> Your problem is that you can not send anything to the browser before the
> Header command.
> 
> Only after it.
> 
> HTH,
> 
> Ernani
> 
> "Zac Hillier" <[EMAIL PROTECTED]> escreveu na mensagem
> 006f01c1f372$88e64c20$667ba8c0@affectors">news:006f01c1f372$88e64c20$667ba8c0@affectors...
> Hi,
> 
> Have been coding in asp for the past 18 months but have now decided to move
> our site to php and mysql.
> 
> In asp we used a function response.redirect to send the user to another page
> as required, is there a similar function in php that can work from within
> side the page rather than the header area? We get
> 
> Warning: Cannot add header information - headers already sent by (output
> started at D:\php-dev\includes\lg.php:2) in D:\php-dev\includes\lg.php on
> line 26
> 
> When using header("Location:
> 
> Many thanks for any help.
> 
> Zac
> 
> 
> 


--- End Message ---
--- Begin Message ---
What if I made a network share and all the sessions were stored in a
shared space?

Matt Babineau
MCWD / CCFD
-----------------------------------------
e: [EMAIL PROTECTED]
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105


-----Original Message-----
From: Luis Ferro [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 18, 2002 5:49 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] SESSIONS- clustered environment


You have two solutions (IMHO):

a) Database storage

    Replacement of the session_init and session_save/register functions 
with others that will save/load the sessions from a database storage.

    Pros: easy to implement
    Cons: dependency of the database storage reliability, scalability 
problems
   
b) Distributed sessions

    Replace the same functions with some that will propagate the session

values to all the servers in the cluster, so that the next request can 
be served by any and the session won't be corrupted. [this would mandate

the existence of a "cluster" layer in the servers configuration]

    Pros: high availability, redundancy and scalability
    Cons: very dificult to implement

The first method can perform better in low trafic environments... but 
will scale worst as the trafic will rise... the second method is much 
more granular, with the performance cost more stable in all trafic 
conditions,

The first method will have is performance dependent on the performance 
of the database storage... the second method will have performance 
dependent on how many servers exist to syncronize the sessions...

The non-cluster solution would be to have all the sessions register in 
only one server, and get all the content in a second line of web 
servers... that way, the main server would only handle connections and 
sessions, with all the content and data communications bellonging to the

second line servers...

Cheers,
Luis Ferro
TelaDigital

Matt Babineau wrote:

>What would be the best way to handle sessions in a clustered 
>environment without making the load-balancing persistant?
> 
>Matt Babineau
>MCWD / CCFD
>-----------------------------------------
>e:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
>p: 603.943.4237
>w:  <http://www.criticalcode.com/> http://www.criticalcode.com PO BOX 
>601 Manchester, NH 03105
> 
>
>  
>



---
[This E-mail scanned for viruses by Declude Virus]


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


--- End Message ---
--- Begin Message ---
Matt Babineau wrote:

>What if I made a network share and all the sessions were stored in a
>shared space?
>  
>
In that case you are making the whole cluster in the health of the 
network file system (ie... the file system + the network sharing 
system)... but that wouldn't work, because if the user changes from the 
server a to the server b, it gets a new session initiated, because in 
that server, he hasn't a session... [or he has... depends on how php 
handles the session cookie and the session temp files]...

For instance... if PHP registers in the session temp file the name of 
the server and the ip, then the user, has it is accessing from a 
diferent server (with diferent ip and name), then even if the cookie is 
ok (ie is created using the root domain, and all the servers in the 
cluster are in the rule of *.domain.tld), it will not match with the 
file, with the consequence of generating a new session and the override 
of the session cookie. If the session temp file only registers the same 
root as the cookie, then, if all the servers follow the name rule of 
*.domain.tld, the session is persistent thru all the servers that use 
that share and comply with the naming rule... i've no idea of which is 
the case... testing will reveal...

I would only deploy to production environment a session solution (either 
the share or any other) that supports clusters of servers after 
intensive testing...

Cheers...
Luis Ferro
TelaDigital.Net



>Matt Babineau
>MCWD / CCFD
>-----------------------------------------
>e: [EMAIL PROTECTED]
>p: 603.943.4237
>w: http://www.criticalcode.com
>PO BOX 601
>Manchester, NH 03105
>
>
>-----Original Message-----
>From: Luis Ferro [mailto:[EMAIL PROTECTED]] 
>Sent: Wednesday, September 18, 2002 5:49 AM
>To: [EMAIL PROTECTED]
>Subject: Re: [PHP-WIN] SESSIONS- clustered environment
>
>
>You have two solutions (IMHO):
>
>a) Database storage
>
>    Replacement of the session_init and session_save/register functions 
>with others that will save/load the sessions from a database storage.
>
>    Pros: easy to implement
>    Cons: dependency of the database storage reliability, scalability 
>problems
>   
>b) Distributed sessions
>
>    Replace the same functions with some that will propagate the session
>
>values to all the servers in the cluster, so that the next request can 
>be served by any and the session won't be corrupted. [this would mandate
>
>the existence of a "cluster" layer in the servers configuration]
>
>    Pros: high availability, redundancy and scalability
>    Cons: very dificult to implement
>
>The first method can perform better in low trafic environments... but 
>will scale worst as the trafic will rise... the second method is much 
>more granular, with the performance cost more stable in all trafic 
>conditions,
>
>The first method will have is performance dependent on the performance 
>of the database storage... the second method will have performance 
>dependent on how many servers exist to syncronize the sessions...
>
>The non-cluster solution would be to have all the sessions register in 
>only one server, and get all the content in a second line of web 
>servers... that way, the main server would only handle connections and 
>sessions, with all the content and data communications bellonging to the
>
>second line servers...
>
>Cheers,
>Luis Ferro
>TelaDigital
>
>Matt Babineau wrote:
>
>  
>
>>What would be the best way to handle sessions in a clustered 
>>environment without making the load-balancing persistant?
>>
>>Matt Babineau
>>MCWD / CCFD
>>-----------------------------------------
>>e:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
>>p: 603.943.4237
>>w:  <http://www.criticalcode.com/> http://www.criticalcode.com PO BOX 
>>601 Manchester, NH 03105
>>
>>
>> 
>>
>>    
>>
>
>
>
>---
>[This E-mail scanned for viruses by Declude Virus]
>
>
>  
>



---
[This E-mail scanned for viruses by Declude Virus]

--- End Message ---
--- Begin Message ---
That's what I was thinking. Do you have a few machines you could try it
with? You could also try something like that using a bunch of VMWare (or
similar virtual machine) systems...

-Dash

-----Original Message-----
From: Matt Babineau [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 18, 2002 7:29 AM
To: 'Luis Ferro'; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] SESSIONS- clustered environment


What if I made a network share and all the sessions were stored in a
shared space?

Matt Babineau
MCWD / CCFD
-----------------------------------------
e: [EMAIL PROTECTED]
p: 603.943.4237
w: http://www.criticalcode.com
PO BOX 601
Manchester, NH 03105


-----Original Message-----
From: Luis Ferro [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 18, 2002 5:49 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] SESSIONS- clustered environment


You have two solutions (IMHO):

a) Database storage

    Replacement of the session_init and session_save/register functions 
with others that will save/load the sessions from a database storage.

    Pros: easy to implement
    Cons: dependency of the database storage reliability, scalability 
problems
   
b) Distributed sessions

    Replace the same functions with some that will propagate the session

values to all the servers in the cluster, so that the next request can 
be served by any and the session won't be corrupted. [this would mandate

the existence of a "cluster" layer in the servers configuration]

    Pros: high availability, redundancy and scalability
    Cons: very dificult to implement

The first method can perform better in low trafic environments... but 
will scale worst as the trafic will rise... the second method is much 
more granular, with the performance cost more stable in all trafic 
conditions,

The first method will have is performance dependent on the performance 
of the database storage... the second method will have performance 
dependent on how many servers exist to syncronize the sessions...

The non-cluster solution would be to have all the sessions register in 
only one server, and get all the content in a second line of web 
servers... that way, the main server would only handle connections and 
sessions, with all the content and data communications bellonging to the

second line servers...

Cheers,
Luis Ferro
TelaDigital

Matt Babineau wrote:

>What would be the best way to handle sessions in a clustered 
>environment without making the load-balancing persistant?
> 
>Matt Babineau
>MCWD / CCFD
>-----------------------------------------
>e:  <mailto:[EMAIL PROTECTED]> [EMAIL PROTECTED]
>p: 603.943.4237
>w:  <http://www.criticalcode.com/> http://www.criticalcode.com PO BOX 
>601 Manchester, NH 03105
> 
>
>  
>



---
[This E-mail scanned for viruses by Declude Virus]


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



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I tried upgrading to 4.2.3 using the PHP 4.2.3 Installer.  I got numerous
errors when booting windows about not being able to find this or that.  I
replaced php4ts.dll with original and I do not get the errors but my PHP
pages no longer work. I get the error

CGI Error
The specified CGI application misbehaved by not returning a complete set of
HTTP headers. The headers it did return are:

I looked at the App Mapping and see .php, .php3 and .html mapped to
c:\php\php.exe Verbs = "all".

Should I be using the ISAPI? If so how do I fix my problem.

Thanks,

Lanham.

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

Is it possible to have different php.ini on IIS ?

Let's say that I have 10 differebt sites running on IIS, can i then specify
a php.ini for each site, anf if yes, how ?

Thanks in advance
Steen

--- End Message ---
--- Begin Message ---
Assuming the CGI version loads php.ini on each request
(http://www.php.net/manual/en/configuration.php), it would be possible to
locate varied php.ini files in the folder with each mapped application
(php.exe).  But I have no idea how simultaneous requests are handled.  

Give it a shot.  Just try removing the php.ini from a common system path
like c:\winnt and putting a copy into each php folder you need along with a
copy of php.exe.  Then map the PHP app per site in IIS to different folders.


-----Original Message-----
From: Steen Rabol [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 18, 2002 4:19 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] php.ini pr. site

Hi

Is it possible to have different php.ini on IIS ?

Let's say that I have 10 differebt sites running on IIS, can i then specify
a php.ini for each site, anf if yes, how ?

Thanks in advance
Steen


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
I am trying to insert text into a text database field that contains single
quotes.  What it the best method?

I am currently doing a URLENCODE($text) upon insertion, then
STRIPSLASHES(URLDECODE($text)) to view.

Lanham.

--- End Message ---
--- Begin Message ---
I use addslashes() frequently, although urlencode works too. I find
addslashes to be cleaner.

-Dash

-----Original Message-----
From: Lanham Rattan [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 18, 2002 2:40 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Inserting text with single quotes into database


I am trying to insert text into a text database field that contains single
quotes.  What it the best method?

I am currently doing a URLENCODE($text) upon insertion, then
STRIPSLASHES(URLDECODE($text)) to view.

Lanham.


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi Lanham
Use addslashes() if gpc magic quotes is off.
Cheers
Rich


-----Original Message-----
From: Lanham Rattan [mailto:[EMAIL PROTECTED]]
Sent: 18 September 2002 14:40
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Inserting text with single quotes into database


I am trying to insert text into a text database field that contains single
quotes.  What it the best method?

I am currently doing a URLENCODE($text) upon insertion, then
STRIPSLASHES(URLDECODE($text)) to view.

Lanham.


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

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


I am using PHP with Windows XP. I am trying to have a ".exe" program (written and 
compiled in C) launched by my PHP script, using either system(), passthru()... That 
works great ... as long as I only have one request at a time. When I have two (or more 
request) at the same time (coming from different browser sessions), the execution of 
the .exe program seems to be aborted for all sessions as soon as it is finished for 
one of the sessions. Therefore only the first finishing session gets the good result, 
the other sessions keeping waiting for an output that will never come. 

The same problem arises if those are different .exe programs that are launched at the 
same time, for example program1.exe, program2.exe and program3.exe ; if program1.exe 
ends first, program2.exe and program3.exe get aborted ... How come ? How can I avoid 
that ? 

By advance, thank you for your help and comments ...

Best regards from Belgium,


                    Jean-Marc
--- End Message ---
--- Begin Message ---

how do i upload pics to the postgres database?

i really don't know how...

i'm using the html   <input type=file . . . . 

what's the script when i press submit button..

i understand that i will send it to a file where it has a script there 
that will process the insertion to the postgres database, what's the 
script then?

thanks a lot to you all,

francis ted a. seguerra
msu - iit
philippines


-- 
ov3rr|d3r

--- End Message ---

Reply via email to