php-general Digest 28 Jun 2011 15:13:01 -0000 Issue 7380

Topics (messages 313771 through 313780):

header function odd behavior
        313771 by: H Rao
        313772 by: Nilesh Govindarajan
        313776 by: Ford, Mike

caching problem
        313773 by: Fatih P.
        313774 by: Nilesh Govindarajan
        313775 by: Fatih P.
        313777 by: Stuart Dallas
        313778 by: admin.buskirkgraphics.com
        313779 by: Stuart Dallas
        313780 by: admin.buskirkgraphics.com

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi,

I am trying to understand odd(different) behavior of the header function
under two different environments.

Here is the code which I am trying to execute from two different servers

<?
header ("Set-Cookie: c1=value1;path=/; domain=.domain.com");
header ("Set-Cookie: c2=value2;path=/; domain=.domain.com");
?>

When executed from server1(OS X), both cookies are set in browser, but when
executed from server2(Linux), only the second cookie is set.

server1 and server2 are running different OS and php version as below. I
know I could add $replace=false option on the Linux server, but I am trying
to understand the different behavior of header() function on these two
servers. Any thoughts?

server1 - OS X
----------------------------------------------
PHP Version 5.2.4

System  Darwin host2.domain.com 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct
29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386
----------------------------------------------
server2 - Linux
----------------------------------------------
PHP Version 5.3.5

System  Linux host1.domain.com 2.6.18-164.15.1.0.1.el5 #1 SMP Wed Mar 17
01:10:06 EDT 2010 x86_64

-Rao

--- End Message ---
--- Begin Message ---
On 06/28/2011 09:10 AM, H Rao wrote:
> Hi,
>
> I am trying to understand odd(different) behavior of the header function
> under two different environments.
>
> Here is the code which I am trying to execute from two different servers
>
> <?
> header ("Set-Cookie: c1=value1;path=/; domain=.domain.com");
> header ("Set-Cookie: c2=value2;path=/; domain=.domain.com");
> ?>
>
> When executed from server1(OS X), both cookies are set in browser, but when
> executed from server2(Linux), only the second cookie is set.
>
> server1 and server2 are running different OS and php version as below. I
> know I could add $replace=false option on the Linux server, but I am trying
> to understand the different behavior of header() function on these two
> servers. Any thoughts?
>
<snip>

I don't have a clear idea about this because I always use setcookie(),
but something tells me that this has something to do with output
buffering and friends.

-- 
Regards,
Nilesh Govindarajan
@nileshgr


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: H Rao [mailto:hydsd...@gmail.com]
> Sent: 28 June 2011 04:40
> 
> I am trying to understand odd(different) behavior of the header
> function
> under two different environments.
> 
> Here is the code which I am trying to execute from two different
> servers
> 
> <?
> header ("Set-Cookie: c1=value1;path=/; domain=.domain.com");
> header ("Set-Cookie: c2=value2;path=/; domain=.domain.com");
> ?>
> 
> When executed from server1(OS X), both cookies are set in browser,
> but when
> executed from server2(Linux), only the second cookie is set.
> 
> server1 and server2 are running different OS and php version as
> below. I
> know I could add $replace=false option on the Linux server, but I am
> trying
> to understand the different behavior of header() function on these
> two
> servers. Any thoughts?

Well, according to the manual, you need to be using the FALSE parameter anyway 
since "By default it will replace, but if you pass in FALSE as the second 
argument you can force multiple headers". So the wrong behaviour is on the 
(older) OS X server, but I'm as confused as you as to why this should be as 
there is no indication in the manual or the ChangeLog that the default 
behaviour has changed at any point.

Cheers!

Mike
-- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Leeds Metropolitan University, Portland PD507, City Campus, 
Portland Way, LEEDS,  LS1 3HE,  United Kingdom 
E: m.f...@leedsmet.ac.uk     T: +44 113 812 4730





To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

--- End Message ---
--- Begin Message ---
Hi guys,

the code files are being cached. and modifications in methods are skipped
and not executed. is there any parameter that i can pass it from ini file?
this has been so annoying for me. restarting apache, windows, etc does not
even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
any ideas how to avoid this situation? thanks

Fatih

--- End Message ---
--- Begin Message ---
On 06/28/2011 10:56 AM, Fatih P. wrote:
> Hi guys,
>
> the code files are being cached. and modifications in methods are skipped
> and not executed. is there any parameter that i can pass it from ini file?
> this has been so annoying for me. restarting apache, windows, etc does not
> even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
> any ideas how to avoid this situation? thanks
>
> Fatih
>

It seems you have a wrongly configured opcode cache runnning about which
you're not aware of.

-- 
Regards,
Nilesh Govindarajan
@nileshgr on twitter/identica


--- End Message ---
--- Begin Message ---
On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
<cont...@nileshgr.com>wrote:

> On 06/28/2011 10:56 AM, Fatih P. wrote:
> > Hi guys,
> >
> > the code files are being cached. and modifications in methods are skipped
> > and not executed. is there any parameter that i can pass it from ini
> file?
> > this has been so annoying for me. restarting apache, windows, etc does
> not
> > even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
> > any ideas how to avoid this situation? thanks
> >
> > Fatih
> >
>
> It seems you have a wrongly configured opcode cache runnning about which
> you're not aware of.
>
> --
> Regards,
> Nilesh Govindarajan
> @nileshgr on twitter/identica
>
>
basically using default configuration, have not changed anything except the
path for extensions in php.ini.
and there is nothing installed/configured to cache anything.

--- End Message ---
--- Begin Message ---
On Tuesday, 28 June 2011 at 06:57, Fatih P. wrote:
> On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
> <cont...@nileshgr.com (mailto:cont...@nileshgr.com)>wrote:
> 
> > On 06/28/2011 10:56 AM, Fatih P. wrote:
> > > Hi guys,
> > > 
> > > the code files are being cached. and modifications in methods are skipped
> > > and not executed. is there any parameter that i can pass it from ini
> > file?
> > > this has been so annoying for me. restarting apache, windows, etc does
> > not
> > > even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
> > > any ideas how to avoid this situation? thanks
> > > 
> > > Fatih
> > 
> > It seems you have a wrongly configured opcode cache runnning about which
> > you're not aware of.
> > 
> > --
> > Regards,
> > Nilesh Govindarajan
> > @nileshgr on twitter/identica
> basically using default configuration, have not changed anything except the
> path for extensions in php.ini.
> and there is nothing installed/configured to cache anything.

Since restarting Apache does not help, the problem is obviously outside the web 
server. There are two possibilities I can think of...

* Browser caching

* Proxy caching

See if clearing your browser cache helps. If not then you probably have a proxy 
between you and the server that's caching the content.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


--- End Message ---
--- Begin Message ---
If the issue is a caching proxy or browser caching I suggest you look into 
controlling the page caching header.

You can expire the header.

// calc an offset of 24 hours
 $offset = 3600 * 24;
 // calc the string in GMT not localtime and add the offset
 $expire = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
 //output the HTTP header
 Header($expire);

Just a thought.

Richard L. Buskirk


-----Original Message-----
From: Stuart Dallas [mailto:stu...@3ft9.com] 
Sent: Tuesday, June 28, 2011 7:53 AM
To: Fatih P.
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] caching problem

On Tuesday, 28 June 2011 at 06:57, Fatih P. wrote:
> On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
> <cont...@nileshgr.com (mailto:cont...@nileshgr.com)>wrote:
> 
> > On 06/28/2011 10:56 AM, Fatih P. wrote:
> > > Hi guys,
> > > 
> > > the code files are being cached. and modifications in methods are skipped
> > > and not executed. is there any parameter that i can pass it from ini
> > file?
> > > this has been so annoying for me. restarting apache, windows, etc does
> > not
> > > even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
> > > any ideas how to avoid this situation? thanks
> > > 
> > > Fatih
> > 
> > It seems you have a wrongly configured opcode cache runnning about which
> > you're not aware of.
> > 
> > --
> > Regards,
> > Nilesh Govindarajan
> > @nileshgr on twitter/identica
> basically using default configuration, have not changed anything except the
> path for extensions in php.ini.
> and there is nothing installed/configured to cache anything.

Since restarting Apache does not help, the problem is obviously outside the web 
server. There are two possibilities I can think of...

* Browser caching

* Proxy caching

See if clearing your browser cache helps. If not then you probably have a proxy 
between you and the server that's caching the content.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


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


--- End Message ---
--- Begin Message ---
On Tue, Jun 28, 2011 at 1:51 PM, Fatih P. <fatihpirist...@gmail.com> wrote:

>
>
> On Tue, Jun 28, 2011 at 1:52 PM, Stuart Dallas <stu...@3ft9.com> wrote:
>
>> On Tuesday, 28 June 2011 at 06:57, Fatih P. wrote:
>> > On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
>> > <cont...@nileshgr.com (mailto:cont...@nileshgr.com)>wrote:
>> >
>> > > On 06/28/2011 10:56 AM, Fatih P. wrote:
>> > > > Hi guys,
>> > > >
>> > > > the code files are being cached. and modifications in methods are
>> skipped
>> > > > and not executed. is there any parameter that i can pass it from ini
>> > > file?
>> > > > this has been so annoying for me. restarting apache, windows, etc
>> does
>> > > not
>> > > > even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
>> > > > any ideas how to avoid this situation? thanks
>> > > >
>> > > > Fatih
>> > >
>> > > It seems you have a wrongly configured opcode cache runnning about
>> which
>> > > you're not aware of.
>> > >
>> > > --
>> > > Regards,
>> > > Nilesh Govindarajan
>> > > @nileshgr on twitter/identica
>> > basically using default configuration, have not changed anything except
>> the
>> > path for extensions in php.ini.
>> > and there is nothing installed/configured to cache anything.
>>
>> Since restarting Apache does not help, the problem is obviously outside
>> the web server. There are two possibilities I can think of...
>>
>> * Browser caching
>>
>> * Proxy caching
>>
>> See if clearing your browser cache helps. If not then you probably have a
>> proxy between you and the server that's caching the content.
>>
>> -Stuart
>>
>> --
>> Stuart Dallas
>> 3ft9 Ltd
>> http://3ft9.com/
>>
>>
> This is not proxy or browser caching. browser does not receive php code. it
> gets output of php code.


Well thanks, cos I only started doing this whole webby programmy developy
technobabble thing yesterday and I'm still learning the basics!*

How do you know that "modifications in methods are skipped and not
executed"? By looking at the output shown in your browser? The output that
could be cached by proxies and/or your browser?

Or are you running them on the command line, in which case some sort of
opcode cache is probably the culprit, or you're not running the code you
think you are.

-Stuart

*sarcasm!

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/

--- End Message ---
--- Begin Message ---
Faith,

I actually did read from the beginning of the message.

That does not make sense.
PHP files are cached intentionally, the system does not Cache PHP on its own.
Sounds to me like you have an issue re-declaring an object or calling the right 
script/path/class/method something.


I have never heard of PHP being cached unless it was intentionally cached it. 
Thank god for security reason!!!!!
HTML output?? Sure all the time helps the browser load the content faster.

I have a real issue with who ever told you that PHP is being cached, because if 
that was the case there is SERIOUS security hole in your PHP.
I am doubting that.

I have cached PHP, it can be done. 

Are you using APC(Alternative PHP Cache)???

I would not suggest it with complex scripting using classes and methods they 
are the whole reason NOT to cache.


That’s just my opinion.

Richard L. Buskirk

-----Original Message-----
From: Stuart Dallas [mailto:stu...@3ft9.com] 
Sent: Tuesday, June 28, 2011 9:18 AM
To: Fatih P.
Cc: PHP General
Subject: Re: [PHP] caching problem

On Tue, Jun 28, 2011 at 1:51 PM, Fatih P. <fatihpirist...@gmail.com> wrote:

>
>
> On Tue, Jun 28, 2011 at 1:52 PM, Stuart Dallas <stu...@3ft9.com> wrote:
>
>> On Tuesday, 28 June 2011 at 06:57, Fatih P. wrote:
>> > On Tue, Jun 28, 2011 at 7:40 AM, Nilesh Govindarajan
>> > <cont...@nileshgr.com (mailto:cont...@nileshgr.com)>wrote:
>> >
>> > > On 06/28/2011 10:56 AM, Fatih P. wrote:
>> > > > Hi guys,
>> > > >
>> > > > the code files are being cached. and modifications in methods are
>> skipped
>> > > > and not executed. is there any parameter that i can pass it from ini
>> > > file?
>> > > > this has been so annoying for me. restarting apache, windows, etc
>> does
>> > > not
>> > > > even help. im running apache 2.2.19, php ts 5.3.6 on windows 2003 r2
>> > > > any ideas how to avoid this situation? thanks
>> > > >
>> > > > Fatih
>> > >
>> > > It seems you have a wrongly configured opcode cache runnning about
>> which
>> > > you're not aware of.
>> > >
>> > > --
>> > > Regards,
>> > > Nilesh Govindarajan
>> > > @nileshgr on twitter/identica
>> > basically using default configuration, have not changed anything except
>> the
>> > path for extensions in php.ini.
>> > and there is nothing installed/configured to cache anything.
>>
>> Since restarting Apache does not help, the problem is obviously outside
>> the web server. There are two possibilities I can think of...
>>
>> * Browser caching
>>
>> * Proxy caching
>>
>> See if clearing your browser cache helps. If not then you probably have a
>> proxy between you and the server that's caching the content.
>>
>> -Stuart
>>
>> --
>> Stuart Dallas
>> 3ft9 Ltd
>> http://3ft9.com/
>>
>>
> This is not proxy or browser caching. browser does not receive php code. it
> gets output of php code.


Well thanks, cos I only started doing this whole webby programmy developy
technobabble thing yesterday and I'm still learning the basics!*

How do you know that "modifications in methods are skipped and not
executed"? By looking at the output shown in your browser? The output that
could be cached by proxies and/or your browser?

Or are you running them on the command line, in which case some sort of
opcode cache is probably the culprit, or you're not running the code you
think you are.

-Stuart

*sarcasm!

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


--- End Message ---

Reply via email to