php-general Digest 19 Mar 2013 08:46:29 -0000 Issue 8169

Topics (messages 320631 through 320648):

Re: [PHP-DEV] feature request : easy shared memory
        320631 by: Matijn Woudt

Re: significance of escape character in string in PHP
        320632 by: Stuart Dallas
        320634 by: Matijn Woudt

Re: significance of escape character in string in PHP - MySQL
        320633 by: Arno Kuhl

Surge 2013 CFP open
        320635 by: Katherine Jeschke

Session variable not persisting
        320636 by: Éric Oliver Paquette
        320637 by: Matijn Woudt
        320638 by: Éric Oliver Paquette
        320639 by: Matijn Woudt
        320640 by: Éric Oliver Paquette
        320641 by: Éric Oliver Paquette
        320642 by: Matijn Woudt
        320643 by: Éric Oliver Paquette
        320644 by: Éric Oliver Paquette
        320645 by: Ashley Sheridan
        320646 by: Éric Oliver Paquette
        320647 by: Marco Behnke

Compiler for the PHP code
        320648 by: Kevin Peterson

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 ---
On Mon, Mar 18, 2013 at 3:46 AM, Larry Garfield <la...@garfieldtech.com>wrote:

> On 03/14/2013 01:21 PM, Bob Weinand wrote:
>
>> Sharing active memory between processes goes against the "shared nothing"
>>> design of PHP.  The lack of the feature you're describing is itself a
>>> feature. :-)
>>>
>>> If you had real shared memory, then you're now writing a multi-threaded
>>> app.  Even if you aren't using threads per se it's the same level of
>>> potential for spooky action at a distance.  If your problem space really
>>> requires that (and there certainly are those that do), Java or NodeJs will
>>> suit you better because those are built specifically for a
>>> persistent-server model, rather than PHP's shared-nothing design. However,
>>> in practice most PHP/web applications don't need that, because HTTP is a
>>> stateless request/response system.  Shared-nothing more closely models what
>>> the actual environment is doing, and can still be very performant as long
>>> as you don't do anything naive.
>>>
>>> If you're doing something stateful like Web Sockets, then you can run
>>> PHP as a cli application that is its own persistent server rather than as
>>> an Apache add-on.  For that, look at Ratchet: http://socketo.me/
>>>
>>> --Larry Garfield
>>>
>> If PHP should be so restrictive against sharing, why are there extensions
>> like memcached, ...? Someone must have missed this possibility to share
>> rapidly...
>>
>> If I need something like websockets, I use the pthreads extension:
>> perfectly suited for stateful applications.
>>
>> For example: I want to have the database in memory (no, no mysql
>> Memory-tables; this is too slow...) and only do the updates into the
>> database for faster access when most contents are read-only. What are these
>> good reasons against such a feature except it violates the shares-nothing
>> superlative of PHP. (Even if this feature would exist, you can still write
>> PHP without sharing)
>>
>> Bo Weinand
>>
>
> Memcache is out of process.  There are possible race conditions there, but
> FAR fewer and FAR more contained than true multi-threaded environments.
>
> This list has debated the merits of shared-nothing many times before; it
> was a deliberate design decision in the interest of simplifying development
> for the overwhelming majority of users.  If your app is so performance
> sensitive that a memcache lookup is going to bring it to its knees, then
> either you're misusing PHP or you're better off using something other than
> PHP.  (PHP is not the tool for every use case.)
>
> In any event, adding true shared memory to PHP would be nearly impossible
> without completely redesigning the way it interacts with web servers.  The
> alternative is to write your own PHP CLI application that connects to
> sockets itself and runs as a daemon (possibly using the pthreads extention
> as you mention), and cut apache/nginx out of the picture entirely.  If your
> use case calls for that, knock yourself out.  But the "good reasons"
> against adding such a feature is that it would require rewriting everything
> and rearchitecting the entire Apache SAPI, which is not happening any time
> soon.
>
> --Larry Garfield
>
>
I don't see why you would need to cut out apache/nginx. I would set up the
server just like you (Larry) describe, with socket & pthreads, but it would
be far more easier to just create a simple php file inside your
apache/nginx directory. Use something like mod_rewrite to redirect all urls
to this php file. In this file, connect to the application server, send the
request data ($_GET, $_POST, etc) to the application server, and pass all
data retrieved from the application server back to the user.
And there you go, you have an application server.

- Matijn

--- End Message ---
--- Begin Message ---
On 18 Mar 2013, at 15:08, Matijn Woudt <tijn...@gmail.com> wrote:

> On Mon, Mar 18, 2013 at 2:19 PM, Sebastian Krebs <krebs....@gmail.com>wrote:
> 
>> 2013/3/18 Ken Robinson <kenrb...@rbnsn.com>
>> 
>>> 
>>> 
>>> On 18.03.2013 09:10, Norah Jones wrote:
>>> 
>>>> I am having an string which was have few ' (single quote) and few "
>>>> (double quotes) and was not able to insert into the mysql database. I
>>>> have replaced them with \' and \" and everything is fine.
>>>> Though this are fine now but don't understand the working and I could
>>>> have missed few corner cases also. Please suggest the working and also
>>>> if there is some better way to achieve this.
>>>> 
>>> 
>>> You should be using either mysql_real_escape_string or
>>> mysqli_real_escape_string (preferably the later) depending on how you're
>>> accessing the DB.
>> 
>> 
>> You shouldn't use ext/mysql at all!
>> Use prepared statements with PDO_MYSQL or MySQLi
>> 
>> 
> And here comes the flame war again...

There's no need for it to be a flame war. The mysql extension is officially not 
recommended for writing new code, so anyone using it should be informed of this 
fact. I think it should consist of more than "don't use that," but at the very 
least that should cause the questioner to want to know why.

http://php.net/intro.mysql

This issue is problematic for exactly the reason Norah demonstrates above: 
"it's working." Great that in this case it hasn't been left at that, but most 
will see it work and think they've "got it right." I believe the community has 
a responsibility to give good advice and recommend best practices as well as 
directly addressing people's problems, so it's right that things like this get 
repeatedly pointed out where appropriate.

-Stuart

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

--- End Message ---
--- Begin Message ---
On Mon, Mar 18, 2013 at 4:20 PM, Stuart Dallas <stu...@3ft9.com> wrote:

> On 18 Mar 2013, at 15:08, Matijn Woudt <tijn...@gmail.com> wrote:
>
> > On Mon, Mar 18, 2013 at 2:19 PM, Sebastian Krebs <krebs....@gmail.com
> >wrote:
> >
> >> 2013/3/18 Ken Robinson <kenrb...@rbnsn.com>
> >>
> >>>
> >>>
> >>> On 18.03.2013 09:10, Norah Jones wrote:
> >>>
> >>>> I am having an string which was have few ' (single quote) and few "
> >>>> (double quotes) and was not able to insert into the mysql database. I
> >>>> have replaced them with \' and \" and everything is fine.
> >>>> Though this are fine now but don't understand the working and I could
> >>>> have missed few corner cases also. Please suggest the working and also
> >>>> if there is some better way to achieve this.
> >>>>
> >>>
> >>> You should be using either mysql_real_escape_string or
> >>> mysqli_real_escape_string (preferably the later) depending on how
> you're
> >>> accessing the DB.
> >>
> >>
> >> You shouldn't use ext/mysql at all!
> >> Use prepared statements with PDO_MYSQL or MySQLi
> >>
> >>
> > And here comes the flame war again...
>
> There's no need for it to be a flame war. The mysql extension is
> officially not recommended for writing new code, so anyone using it should
> be informed of this fact. I think it should consist of more than "don't use
> that," but at the very least that should cause the questioner to want to
> know why.
>
> http://php.net/intro.mysql
>
> This issue is problematic for exactly the reason Norah demonstrates above:
> "it's working." Great that in this case it hasn't been left at that, but
> most will see it work and think they've "got it right." I believe the
> community has a responsibility to give good advice and recommend best
> practices as well as directly addressing people's problems, so it's right
> that things like this get repeatedly pointed out where appropriate.
>
>
I know ext/mysql is deprecated, though is there any difference between the
procedural mysqli vs ext/mysql, except that mysqli requires $link, whereas
ext/mysql will take the last link opened?

- Matijn

--- End Message ---
--- Begin Message ---
There's no need for it to be a flame war. The mysql extension is officially
not recommended for writing new code, so anyone using it should be informed
of this fact. I think it should consist of more than "don't use that," but
at the very least that should cause the questioner to want to know why.

http://php.net/intro.mysql

This issue is problematic for exactly the reason Norah demonstrates above:
"it's working." Great that in this case it hasn't been left at that, but
most will see it work and think they've "got it right." I believe the
community has a responsibility to give good advice and recommend best
practices as well as directly addressing people's problems, so it's right
that things like this get repeatedly pointed out where appropriate.

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

Thanks, didn't know about this. No doubt it's been general news for months
or years but I see the PHP manual page you linked to was edited 3 days ago.
Will have to see what ADOdb is doing - the last release I saw didn't support
PDO_MySQL or mysqli. I googled and saw a first release of 5.5 will be this
month?

Cheers
Arno


--- End Message ---
--- Begin Message ---
The Surge 2013 CFP is open. For details or to submit a paper, please visit
http://surge.omniti.com/2013

-- 
Katherine Jeschke
Director of Marketing and Creative Services
OmniTI Computer Consulting, Inc.
11830 West Market Place, Suite F
Fulton, MD 20759
O: 240-646-0770, 222
F: 301-497-2001
C: 443/643-6140
omniti.com
Surge 2013 <http://surge.omniti.com/2013>

The information contained in this electronic message and any attached
documents is privileged, confidential, and protected from disclosure.  If
you are not the intended recipient, note that any review, disclosure,
copying, distribution, or use of the contents of this electronic message or
any attached documents is prohibited. If you have received this
communication in error, please destroy it and notify us immediately by
telephone (1-443-325-1360) or by electronic mail (i...@omniti.com). Thank
you.

--- End Message ---
--- Begin Message ---
Hi all, 

I'll be swift in my explanation as I can't find in any way the source of the 
problem; it seems to be installation-related. 

At execution, sometimes (randomly it seems at first), variable session aren't 
properly stored. 

=====================

First things first, about installation : 

uname -a -m -p yields :

Linux cl-t180-253cl.privatedns.com 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 04:16:51 
EST 2012 x86_64 x86_64 x86_64 GNU/Linux

php -v yields :

PHP 5.3.3 (cli) (built: Jun 27 2012 12:25:48) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

=====================

To make sure it is not caused by any other part of my scripts, I just created 
two scripts that have replicated the problem :

SCRIPT #1 [ping.php] ################

<?php

session_start();

if(count($_SESSION['in'])==0){
    $_SESSION['in'][0]='0-initiate';
} else {
    $_SESSION['in'][] = count($_SESSION['in']).$_GET['push'];
}

if(count($_SESSION['in'])<1000){
    $rand = rand(0, 1000000);
    ?>
        <meta http-equiv="refresh" content="0;URL='pong.php?push=<?php echo 
$rand; ?>'">
    <?php
} else {
    var_dump($_SESSION);
}

?>

SCRIPT #2 [pong.php] ################ 

<?php

session_start();

if(count($_SESSION['in'])==0){
    $_SESSION['in'][0]='0-initiate';
} else {
    $_SESSION['in'][] = count($_SESSION['in']).$_GET['push'];
}

if(count($_SESSION['in'])<1000){
    $rand = rand(0, 1000000);
    ?>
        <meta http-equiv="refresh" content="0;URL='ping.php?push=<?php echo 
$rand; ?>'">
    <?php
} else {
    var_dump($_SESSION);
}

?>

##################################

In fact, when I run this on my server I randomly have empty entries in the 
$_SESSION array. Any thoughts on this? Is this a known bug (haven't found it…)

Thanks!

--- End Message ---
--- Begin Message ---
On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette
<eopaque...@gmail.com>wrote:

> Hi all,
>
> I'll be swift in my explanation as I can't find in any way the source of
> the problem; it seems to be installation-related.
>
> At execution, sometimes (randomly it seems at first), variable session
> aren't properly stored.
>
>
> In fact, when I run this on my server I randomly have empty entries in the
> $_SESSION array. Any thoughts on this? Is this a known bug (haven't found
> it…)
>
> Thanks!
>

What does phpinfo() show about session stuff? Especially things like
save_handler and cookie_lifetime settings.

- Matijn

--- End Message ---
--- Begin Message ---
> 
> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette <eopaque...@gmail.com> 
> wrote:
> Hi all,
> 
> I'll be swift in my explanation as I can't find in any way the source of the 
> problem; it seems to be installation-related.
> 
> At execution, sometimes (randomly it seems at first), variable session aren't 
> properly stored.
> 
> 
> In fact, when I run this on my server I randomly have empty entries in the 
> $_SESSION array. Any thoughts on this? Is this a known bug (haven't found it…)
> 
> Thanks!
> 
> What does phpinfo() show about session stuff? Especially things like 
> save_handler and cookie_lifetime settings. 

Note that this seems to occur 3 times out of 1000 on average. 

Now, about your request :

session

Session Support enabled
Registered save handlers        files user
Registered serializer handlers  php php_binary wddx

Directive       Local Value     Master Value
session.auto_start      Off     Off
session.bug_compat_42   Off     Off
session.bug_compat_warn Off     Off
session.cache_expire    180     180
session.cache_limiter   nocache nocache
session.cookie_domain   no value        no value
session.cookie_httponly Off     Off
session.cookie_lifetime 0       0
session.cookie_path     /       /
session.cookie_secure   Off     Off
session.entropy_file    no value        no value
session.entropy_length  0       0
session.gc_divisor      1000    1000
session.gc_maxlifetime  1440    1440
session.gc_probability  1       1
session.hash_bits_per_character 5       5
session.hash_function   0       0
session.name    PHPSESSID       PHPSESSID
session.referer_check   no value        no value
session.save_handler    files   files
session.save_path       /var/lib/php/session    /var/lib/php/session
session.serialize_handler       php     php
session.use_cookies     On      On
session.use_only_cookies        On      On
session.use_trans_sid   0       0

__

Éric

--- End Message ---
--- Begin Message ---
On Mon, Mar 18, 2013 at 8:13 PM, Éric Oliver Paquette
<eopaque...@gmail.com>wrote:

>
>
> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette <
> eopaque...@gmail.com> wrote:
>
> Hi all,
>
>
> I'll be swift in my explanation as I can't find in any way the source of
> the problem; it seems to be installation-related.
>
>
> At execution, sometimes (randomly it seems at first), variable session
> aren't properly stored.
>
>
>
> In fact, when I run this on my server I randomly have empty entries in the
> $_SESSION array. Any thoughts on this? Is this a known bug (haven't found
> it…)
>
>
> Thanks!
>
>
> What does phpinfo() show about session stuff? Especially things like
> save_handler and cookie_lifetime settings.
>
>
> Note that this seems to occur 3 times out of 1000 on average.
>
> Now, about your request :
>
> session
>
> Session Support enabled
> Registered save handlers files user
> Registered serializer handlers php php_binary wddx
>
> Directive Local Value Master Value
> session.auto_start Off Off
> session.bug_compat_42 Off Off
> session.bug_compat_warn Off Off
> session.cache_expire 180 180
> session.cache_limiter nocache nocache
> session.cookie_domain no value no value
> session.cookie_httponly Off Off
> session.cookie_lifetime 0 0
> session.cookie_path / /
> session.cookie_secure Off Off
> session.entropy_file no value no value
> session.entropy_length 0 0
> session.gc_divisor 1000 1000
> session.gc_maxlifetime 1440 1440
> session.gc_probability 1 1
> session.hash_bits_per_character 5 5
> session.hash_function 0 0
> session.name PHPSESSID PHPSESSID
> session.referer_check no value no value
> session.save_handler files files
> session.save_path /var/lib/php/session /var/lib/php/session
> session.serialize_handler php php
> session.use_cookies On On
> session.use_only_cookies On On
> session.use_trans_sid 0 0
>
>
Your settings seem to be fine. My best guess would be hardware failure,
though it seems unlikely. Did you check apache (or whatever webserver
you're using) logs for any errors or warnings?

- Matijn

--- End Message ---
--- Begin Message ---
Le 2013-03-18 à 15:20, Matijn Woudt a écrit :

> 
> 
> 
> On Mon, Mar 18, 2013 at 8:13 PM, Éric Oliver Paquette <eopaque...@gmail.com> 
> wrote:
> 
>> 
>> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette <eopaque...@gmail.com> 
>> wrote:
>> Hi all,
>> 
>> I'll be swift in my explanation as I can't find in any way the source of the 
>> problem; it seems to be installation-related.
>> 
>> At execution, sometimes (randomly it seems at first), variable session 
>> aren't properly stored.
>> 
>> 
>> In fact, when I run this on my server I randomly have empty entries in the 
>> $_SESSION array. Any thoughts on this? Is this a known bug (haven't found 
>> it…)
>> 
>> Thanks!
>> 
>> What does phpinfo() show about session stuff? Especially things like 
>> save_handler and cookie_lifetime settings. 
> 
> Note that this seems to occur 3 times out of 1000 on average. 
> 
> Now, about your request :
> 
> session
> 
> Session Support       enabled
> Registered save handlers      files user
> Registered serializer handlers        php php_binary wddx
> 
> Directive     Local Value     Master Value
> session.auto_start    Off     Off
> session.bug_compat_42 Off     Off
> session.bug_compat_warn       Off     Off
> session.cache_expire  180     180
> session.cache_limiter nocache nocache
> session.cookie_domain no value        no value
> session.cookie_httponly       Off     Off
> session.cookie_lifetime       0       0
> session.cookie_path   /       /
> session.cookie_secure Off     Off
> session.entropy_file  no value        no value
> session.entropy_length        0       0
> session.gc_divisor    1000    1000
> session.gc_maxlifetime        1440    1440
> session.gc_probability        1       1
> session.hash_bits_per_character       5       5
> session.hash_function 0       0
> session.name  PHPSESSID       PHPSESSID
> session.referer_check no value        no value
> session.save_handler  files   files
> session.save_path     /var/lib/php/session    /var/lib/php/session
> session.serialize_handler     php     php
> session.use_cookies   On      On
> session.use_only_cookies      On      On
> session.use_trans_sid 0       0
> 
> 
> Your settings seem to be fine. My best guess would be hardware failure, 
> though it seems unlikely. Did you check apache (or whatever webserver you're 
> using) logs for any errors or warnings?

Yes I did. Everyhting seems normal there too. 

--- End Message ---
--- Begin Message ---
Le 2013-03-18 à 15:24, Éric Oliver Paquette a écrit :

> 
> Le 2013-03-18 à 15:20, Matijn Woudt a écrit :
> 
>> 
>> 
>> 
>> On Mon, Mar 18, 2013 at 8:13 PM, Éric Oliver Paquette <eopaque...@gmail.com> 
>> wrote:
>> 
>>> 
>>> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette 
>>> <eopaque...@gmail.com> wrote:
>>> Hi all,
>>> 
>>> I'll be swift in my explanation as I can't find in any way the source of 
>>> the problem; it seems to be installation-related.
>>> 
>>> At execution, sometimes (randomly it seems at first), variable session 
>>> aren't properly stored.
>>> 
>>> 
>>> In fact, when I run this on my server I randomly have empty entries in the 
>>> $_SESSION array. Any thoughts on this? Is this a known bug (haven't found 
>>> it…)
>>> 
>>> Thanks!
>>> 
>>> What does phpinfo() show about session stuff? Especially things like 
>>> save_handler and cookie_lifetime settings. 
>> 
>> Note that this seems to occur 3 times out of 1000 on average. 
>> 
>> Now, about your request :
>> 
>> session
>> 
>> Session Support      enabled
>> Registered save handlers     files user
>> Registered serializer handlers       php php_binary wddx
>> 
>> Directive    Local Value     Master Value
>> session.auto_start   Off     Off
>> session.bug_compat_42        Off     Off
>> session.bug_compat_warn      Off     Off
>> session.cache_expire 180     180
>> session.cache_limiter        nocache nocache
>> session.cookie_domain        no value        no value
>> session.cookie_httponly      Off     Off
>> session.cookie_lifetime      0       0
>> session.cookie_path  /       /
>> session.cookie_secure        Off     Off
>> session.entropy_file no value        no value
>> session.entropy_length       0       0
>> session.gc_divisor   1000    1000
>> session.gc_maxlifetime       1440    1440
>> session.gc_probability       1       1
>> session.hash_bits_per_character      5       5
>> session.hash_function        0       0
>> session.name PHPSESSID       PHPSESSID
>> session.referer_check        no value        no value
>> session.save_handler files   files
>> session.save_path    /var/lib/php/session    /var/lib/php/session
>> session.serialize_handler    php     php
>> session.use_cookies  On      On
>> session.use_only_cookies     On      On
>> session.use_trans_sid        0       0
>> 
>> 
>> Your settings seem to be fine. My best guess would be hardware failure, 
>> though it seems unlikely. Did you check apache (or whatever webserver you're 
>> using) logs for any errors or warnings?
> 
> Yes I did. Everyhting seems normal there too. 

Hm… Just noticed something new in fact; was looking a last time before 
considering reinstallation on a new server: it seems that the $_GET['push'] is 
undefined. In the other scripts I use where I have this problem, I'm using 
$_POST variables though but still don't get stored in $_SESSION. If I'm 
correct, this may implies that it is apache that is faulty right?



--- End Message ---
--- Begin Message ---
On Mon, Mar 18, 2013 at 8:35 PM, Éric Oliver Paquette
<eopaque...@gmail.com>wrote:

>
> Le 2013-03-18 à 15:24, Éric Oliver Paquette a écrit :
>
>
> Le 2013-03-18 à 15:20, Matijn Woudt a écrit :
>
>
>
>
> On Mon, Mar 18, 2013 at 8:13 PM, Éric Oliver Paquette <
> eopaque...@gmail.com> wrote:
>
>>
>>
>> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette <
>> eopaque...@gmail.com> wrote:
>>
>> Hi all,
>>
>>
>> I'll be swift in my explanation as I can't find in any way the source of
>> the problem; it seems to be installation-related.
>>
>>
>> At execution, sometimes (randomly it seems at first), variable session
>> aren't properly stored.
>>
>>
>>
>> In fact, when I run this on my server I randomly have empty entries in
>> the $_SESSION array. Any thoughts on this? Is this a known bug (haven't
>> found it…)
>>
>>
>> Thanks!
>>
>>
>> What does phpinfo() show about session stuff? Especially things like
>> save_handler and cookie_lifetime settings.
>>
>>
>> Note that this seems to occur 3 times out of 1000 on average.
>>
>> Now, about your request :
>>
>> session
>>
>> Session Support enabled
>> Registered save handlers files user
>> Registered serializer handlers php php_binary wddx
>>
>> Directive Local Value Master Value
>> session.auto_start Off Off
>> session.bug_compat_42 Off Off
>> session.bug_compat_warn Off Off
>> session.cache_expire 180 180
>> session.cache_limiter nocache nocache
>> session.cookie_domain no value no value
>> session.cookie_httponly Off Off
>> session.cookie_lifetime 0 0
>> session.cookie_path / /
>> session.cookie_secure Off Off
>> session.entropy_file no value no value
>> session.entropy_length 0 0
>> session.gc_divisor 1000 1000
>> session.gc_maxlifetime 1440 1440
>> session.gc_probability 1 1
>> session.hash_bits_per_character 5 5
>> session.hash_function 0 0
>> session.name PHPSESSID PHPSESSID
>> session.referer_check no value no value
>> session.save_handler files files
>> session.save_path /var/lib/php/session /var/lib/php/session
>> session.serialize_handler php php
>> session.use_cookies On On
>> session.use_only_cookies On On
>> session.use_trans_sid 0 0
>>
>>
> Your settings seem to be fine. My best guess would be hardware failure,
> though it seems unlikely. Did you check apache (or whatever webserver
> you're using) logs for any errors or warnings?
>
>
> Yes I did. Everyhting seems normal there too.
>
>
> Hm… Just noticed something new in fact; was looking a last time before
> considering reinstallation on a new server: it seems that the $_GET['push']
> is undefined. In the other scripts I use where I have this problem, I'm
> using $_POST variables though but still don't get stored in $_SESSION. If
> I'm correct, this may implies that it is apache that is faulty right?
>
>
>
$_GET['push'] will be undefined if you still have your session stored, but
accessing the script directly. It should have nothing to do with faulty
Apache.

--- End Message ---
--- Begin Message ---
Le 2013-03-18 à 15:37, Matijn Woudt a écrit :

> 
> 
> 
> On Mon, Mar 18, 2013 at 8:35 PM, Éric Oliver Paquette <eopaque...@gmail.com> 
> wrote:
> 
> Le 2013-03-18 à 15:24, Éric Oliver Paquette a écrit :
> 
>> 
>> Le 2013-03-18 à 15:20, Matijn Woudt a écrit :
>> 
>>> 
>>> 
>>> 
>>> On Mon, Mar 18, 2013 at 8:13 PM, Éric Oliver Paquette 
>>> <eopaque...@gmail.com> wrote:
>>> 
>>>> 
>>>> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette 
>>>> <eopaque...@gmail.com> wrote:
>>>> Hi all,
>>>> 
>>>> I'll be swift in my explanation as I can't find in any way the source of 
>>>> the problem; it seems to be installation-related.
>>>> 
>>>> At execution, sometimes (randomly it seems at first), variable session 
>>>> aren't properly stored.
>>>> 
>>>> 
>>>> In fact, when I run this on my server I randomly have empty entries in the 
>>>> $_SESSION array. Any thoughts on this? Is this a known bug (haven't found 
>>>> it…)
>>>> 
>>>> Thanks!
>>>> 
>>>> What does phpinfo() show about session stuff? Especially things like 
>>>> save_handler and cookie_lifetime settings. 
>>> 
>>> Note that this seems to occur 3 times out of 1000 on average. 
>>> 
>>> Now, about your request :
>>> 
>>> session
>>> 
>>> Session Support     enabled
>>> Registered save handlers    files user
>>> Registered serializer handlers      php php_binary wddx
>>> 
>>> Directive   Local Value     Master Value
>>> session.auto_start  Off     Off
>>> session.bug_compat_42       Off     Off
>>> session.bug_compat_warn     Off     Off
>>> session.cache_expire        180     180
>>> session.cache_limiter       nocache nocache
>>> session.cookie_domain       no value        no value
>>> session.cookie_httponly     Off     Off
>>> session.cookie_lifetime     0       0
>>> session.cookie_path /       /
>>> session.cookie_secure       Off     Off
>>> session.entropy_file        no value        no value
>>> session.entropy_length      0       0
>>> session.gc_divisor  1000    1000
>>> session.gc_maxlifetime      1440    1440
>>> session.gc_probability      1       1
>>> session.hash_bits_per_character     5       5
>>> session.hash_function       0       0
>>> session.name        PHPSESSID       PHPSESSID
>>> session.referer_check       no value        no value
>>> session.save_handler        files   files
>>> session.save_path   /var/lib/php/session    /var/lib/php/session
>>> session.serialize_handler   php     php
>>> session.use_cookies On      On
>>> session.use_only_cookies    On      On
>>> session.use_trans_sid       0       0
>>> 
>>> 
>>> Your settings seem to be fine. My best guess would be hardware failure, 
>>> though it seems unlikely. Did you check apache (or whatever webserver 
>>> you're using) logs for any errors or warnings?
>> 
>> Yes I did. Everyhting seems normal there too. 
> 
> Hm… Just noticed something new in fact; was looking a last time before 
> considering reinstallation on a new server: it seems that the $_GET['push'] 
> is undefined. In the other scripts I use where I have this problem, I'm using 
> $_POST variables though but still don't get stored in $_SESSION. If I'm 
> correct, this may implies that it is apache that is faulty right?
> 
> 
> 
> $_GET['push'] will be undefined if you still have your session stored, but 
> accessing the script directly. It should have nothing to do with faulty 
> Apache. 

Okay, let me paraphrase: when I run the ping pong scripts written up there, I 
have a blank in var_dump($_SESSION) if and only if I have 

[Mon Mar 18 13:25:37 2013] [error] [client 184.151.114.111] PHP Notice:  
Undefined index: push in 
/home/www/www.ngenioconnect.com/Modules/MPOSurveyTest/pong.php on line 8

on apache log. So my question really is, it is apache that handles the posts 
and gets requests, as I use both and it seems that the non-persistence of data 
occurs before the storage in $_SESSION, is it possible that it is Apache that 
is faulty?



> 


--- End Message ---
--- Begin Message ---
Le 2013-03-18 à 15:41, Éric Oliver Paquette a écrit :

> 
> Le 2013-03-18 à 15:37, Matijn Woudt a écrit :
> 
>> 
>> 
>> 
>> On Mon, Mar 18, 2013 at 8:35 PM, Éric Oliver Paquette <eopaque...@gmail.com> 
>> wrote:
>> 
>> Le 2013-03-18 à 15:24, Éric Oliver Paquette a écrit :
>> 
>>> 
>>> Le 2013-03-18 à 15:20, Matijn Woudt a écrit :
>>> 
>>>> 
>>>> 
>>>> 
>>>> On Mon, Mar 18, 2013 at 8:13 PM, Éric Oliver Paquette 
>>>> <eopaque...@gmail.com> wrote:
>>>> 
>>>>> 
>>>>> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette 
>>>>> <eopaque...@gmail.com> wrote:
>>>>> Hi all,
>>>>> 
>>>>> I'll be swift in my explanation as I can't find in any way the source of 
>>>>> the problem; it seems to be installation-related.
>>>>> 
>>>>> At execution, sometimes (randomly it seems at first), variable session 
>>>>> aren't properly stored.
>>>>> 
>>>>> 
>>>>> In fact, when I run this on my server I randomly have empty entries in 
>>>>> the $_SESSION array. Any thoughts on this? Is this a known bug (haven't 
>>>>> found it…)
>>>>> 
>>>>> Thanks!
>>>>> 
>>>>> What does phpinfo() show about session stuff? Especially things like 
>>>>> save_handler and cookie_lifetime settings. 
>>>> 
>>>> Note that this seems to occur 3 times out of 1000 on average. 
>>>> 
>>>> Now, about your request :
>>>> 
>>>> session
>>>> 
>>>> Session Support    enabled
>>>> Registered save handlers   files user
>>>> Registered serializer handlers     php php_binary wddx
>>>> 
>>>> Directive  Local Value     Master Value
>>>> session.auto_start Off     Off
>>>> session.bug_compat_42      Off     Off
>>>> session.bug_compat_warn    Off     Off
>>>> session.cache_expire       180     180
>>>> session.cache_limiter      nocache nocache
>>>> session.cookie_domain      no value        no value
>>>> session.cookie_httponly    Off     Off
>>>> session.cookie_lifetime    0       0
>>>> session.cookie_path        /       /
>>>> session.cookie_secure      Off     Off
>>>> session.entropy_file       no value        no value
>>>> session.entropy_length     0       0
>>>> session.gc_divisor 1000    1000
>>>> session.gc_maxlifetime     1440    1440
>>>> session.gc_probability     1       1
>>>> session.hash_bits_per_character    5       5
>>>> session.hash_function      0       0
>>>> session.name       PHPSESSID       PHPSESSID
>>>> session.referer_check      no value        no value
>>>> session.save_handler       files   files
>>>> session.save_path  /var/lib/php/session    /var/lib/php/session
>>>> session.serialize_handler  php     php
>>>> session.use_cookies        On      On
>>>> session.use_only_cookies   On      On
>>>> session.use_trans_sid      0       0
>>>> 
>>>> 
>>>> Your settings seem to be fine. My best guess would be hardware failure, 
>>>> though it seems unlikely. Did you check apache (or whatever webserver 
>>>> you're using) logs for any errors or warnings?
>>> 
>>> Yes I did. Everyhting seems normal there too. 
>> 
>> Hm… Just noticed something new in fact; was looking a last time before 
>> considering reinstallation on a new server: it seems that the $_GET['push'] 
>> is undefined. In the other scripts I use where I have this problem, I'm 
>> using $_POST variables though but still don't get stored in $_SESSION. If 
>> I'm correct, this may implies that it is apache that is faulty right?
>> 
>> 
>> 
>> $_GET['push'] will be undefined if you still have your session stored, but 
>> accessing the script directly. It should have nothing to do with faulty 
>> Apache. 
> 
> Okay, let me paraphrase: when I run the ping pong scripts written up there, I 
> have a blank in var_dump($_SESSION) if and only if I have 
> 
> [Mon Mar 18 13:25:37 2013] [error] [client 184.151.114.111] PHP Notice:  
> Undefined index: push in 
> /home/www/www.ngenioconnect.com/Modules/MPOSurveyTest/pong.php on line 8
> 
> on apache log. So my question really is, it is apache that handles the posts 
> and gets requests, as I use both and it seems that the non-persistence of 
> data occurs before the storage in $_SESSION, is it possible that it is Apache 
> that is faulty?
Er… I looked where it caused a problem, it seems that $_GET, $_POST and 
$_SESSION are indeed all affected. Any clue of a faulty installation that would 
cause problem for many surperglobals? 



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

"Éric Oliver Paquette" <eopaque...@gmail.com> wrote:

>
>Le 2013-03-18 à 15:41, Éric Oliver Paquette a écrit :
>
>> 
>> Le 2013-03-18 à 15:37, Matijn Woudt a écrit :
>> 
>>> 
>>> 
>>> 
>>> On Mon, Mar 18, 2013 at 8:35 PM, Éric Oliver Paquette
><eopaque...@gmail.com> wrote:
>>> 
>>> Le 2013-03-18 à 15:24, Éric Oliver Paquette a écrit :
>>> 
>>>> 
>>>> Le 2013-03-18 à 15:20, Matijn Woudt a écrit :
>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> On Mon, Mar 18, 2013 at 8:13 PM, Éric Oliver Paquette
><eopaque...@gmail.com> wrote:
>>>>> 
>>>>>> 
>>>>>> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette
><eopaque...@gmail.com> wrote:
>>>>>> Hi all,
>>>>>> 
>>>>>> I'll be swift in my explanation as I can't find in any way the
>source of the problem; it seems to be installation-related.
>>>>>> 
>>>>>> At execution, sometimes (randomly it seems at first), variable
>session aren't properly stored.
>>>>>> 
>>>>>> 
>>>>>> In fact, when I run this on my server I randomly have empty
>entries in the $_SESSION array. Any thoughts on this? Is this a known
>bug (haven't found it…)
>>>>>> 
>>>>>> Thanks!
>>>>>> 
>>>>>> What does phpinfo() show about session stuff? Especially things
>like save_handler and cookie_lifetime settings. 
>>>>> 
>>>>> Note that this seems to occur 3 times out of 1000 on average. 
>>>>> 
>>>>> Now, about your request :
>>>>> 
>>>>> session
>>>>> 
>>>>> Session Support   enabled
>>>>> Registered save handlers  files user
>>>>> Registered serializer handlers    php php_binary wddx
>>>>> 
>>>>> Directive Local Value     Master Value
>>>>> session.auto_start        Off     Off
>>>>> session.bug_compat_42     Off     Off
>>>>> session.bug_compat_warn   Off     Off
>>>>> session.cache_expire      180     180
>>>>> session.cache_limiter     nocache nocache
>>>>> session.cookie_domain     no value        no value
>>>>> session.cookie_httponly   Off     Off
>>>>> session.cookie_lifetime   0       0
>>>>> session.cookie_path       /       /
>>>>> session.cookie_secure     Off     Off
>>>>> session.entropy_file      no value        no value
>>>>> session.entropy_length    0       0
>>>>> session.gc_divisor        1000    1000
>>>>> session.gc_maxlifetime    1440    1440
>>>>> session.gc_probability    1       1
>>>>> session.hash_bits_per_character   5       5
>>>>> session.hash_function     0       0
>>>>> session.name      PHPSESSID       PHPSESSID
>>>>> session.referer_check     no value        no value
>>>>> session.save_handler      files   files
>>>>> session.save_path /var/lib/php/session    /var/lib/php/session
>>>>> session.serialize_handler php     php
>>>>> session.use_cookies       On      On
>>>>> session.use_only_cookies  On      On
>>>>> session.use_trans_sid     0       0
>>>>> 
>>>>> 
>>>>> Your settings seem to be fine. My best guess would be hardware
>failure, though it seems unlikely. Did you check apache (or whatever
>webserver you're using) logs for any errors or warnings?
>>>> 
>>>> Yes I did. Everyhting seems normal there too. 
>>> 
>>> Hm… Just noticed something new in fact; was looking a last time
>before considering reinstallation on a new server: it seems that the
>$_GET['push'] is undefined. In the other scripts I use where I have
>this problem, I'm using $_POST variables though but still don't get
>stored in $_SESSION. If I'm correct, this may implies that it is apache
>that is faulty right?
>>> 
>>> 
>>> 
>>> $_GET['push'] will be undefined if you still have your session
>stored, but accessing the script directly. It should have nothing to do
>with faulty Apache. 
>> 
>> Okay, let me paraphrase: when I run the ping pong scripts written up
>there, I have a blank in var_dump($_SESSION) if and only if I have 
>> 
>> [Mon Mar 18 13:25:37 2013] [error] [client 184.151.114.111] PHP
>Notice:  Undefined index: push in
>/home/www/www.ngenioconnect.com/Modules/MPOSurveyTest/pong.php on line
>8
>> 
>> on apache log. So my question really is, it is apache that handles
>the posts and gets requests, as I use both and it seems that the
>non-persistence of data occurs before the storage in $_SESSION, is it
>possible that it is Apache that is faulty?
>Er… I looked where it caused a problem, it seems that $_GET, $_POST and
>$_SESSION are indeed all affected. Any clue of a faulty installation
>that would cause problem for many surperglobals? 

It sounds like some kind of memory problem. Can you run a memory tester on that 
server to see if that's the cause? 

Thanks,
Ash
http://www.ashleysheridan.co.uk

--- End Message ---
--- Begin Message ---
Le 2013-03-18 à 15:41, Éric Oliver Paquette a écrit :

> 
> Le 2013-03-18 à 15:37, Matijn Woudt a écrit :
> 
>> 
>> 
>> 
>> On Mon, Mar 18, 2013 at 8:35 PM, Éric Oliver Paquette <eopaque...@gmail.com> 
>> wrote:
>> 
>> Le 2013-03-18 à 15:24, Éric Oliver Paquette a écrit :
>> 
>>> 
>>> Le 2013-03-18 à 15:20, Matijn Woudt a écrit :
>>> 
>>>> 
>>>> 
>>>> 
>>>> On Mon, Mar 18, 2013 at 8:13 PM, Éric Oliver Paquette 
>>>> <eopaque...@gmail.com> wrote:
>>>> 
>>>>> 
>>>>> On Mon, Mar 18, 2013 at 7:46 PM, Éric Oliver Paquette 
>>>>> <eopaque...@gmail.com> wrote:
>>>>> Hi all,
>>>>> 
>>>>> I'll be swift in my explanation as I can't find in any way the source of 
>>>>> the problem; it seems to be installation-related.
>>>>> 
>>>>> At execution, sometimes (randomly it seems at first), variable session 
>>>>> aren't properly stored.
>>>>> 
>>>>> 
>>>>> In fact, when I run this on my server I randomly have empty entries in 
>>>>> the $_SESSION array. Any thoughts on this? Is this a known bug (haven't 
>>>>> found it…)
>>>>> 
>>>>> Thanks!
>>>>> 
>>>>> What does phpinfo() show about session stuff? Especially things like 
>>>>> save_handler and cookie_lifetime settings. 
>>>> 
>>>> Note that this seems to occur 3 times out of 1000 on average. 
>>>> 
>>>> Now, about your request :
>>>> 
>>>> session
>>>> 
>>>> Session Support    enabled
>>>> Registered save handlers   files user
>>>> Registered serializer handlers     php php_binary wddx
>>>> 
>>>> Directive  Local Value     Master Value
>>>> session.auto_start Off     Off
>>>> session.bug_compat_42      Off     Off
>>>> session.bug_compat_warn    Off     Off
>>>> session.cache_expire       180     180
>>>> session.cache_limiter      nocache nocache
>>>> session.cookie_domain      no value        no value
>>>> session.cookie_httponly    Off     Off
>>>> session.cookie_lifetime    0       0
>>>> session.cookie_path        /       /
>>>> session.cookie_secure      Off     Off
>>>> session.entropy_file       no value        no value
>>>> session.entropy_length     0       0
>>>> session.gc_divisor 1000    1000
>>>> session.gc_maxlifetime     1440    1440
>>>> session.gc_probability     1       1
>>>> session.hash_bits_per_character    5       5
>>>> session.hash_function      0       0
>>>> session.name       PHPSESSID       PHPSESSID
>>>> session.referer_check      no value        no value
>>>> session.save_handler       files   files
>>>> session.save_path  /var/lib/php/session    /var/lib/php/session
>>>> session.serialize_handler  php     php
>>>> session.use_cookies        On      On
>>>> session.use_only_cookies   On      On
>>>> session.use_trans_sid      0       0
>>>> 
>>>> 
>>>> Your settings seem to be fine. My best guess would be hardware failure, 
>>>> though it seems unlikely. Did you check apache (or whatever webserver 
>>>> you're using) logs for any errors or warnings?
>>> 
>>> Yes I did. Everyhting seems normal there too. 
>> 
>> Hm… Just noticed something new in fact; was looking a last time before 
>> considering reinstallation on a new server: it seems that the $_GET['push'] 
>> is undefined. In the other scripts I use where I have this problem, I'm 
>> using $_POST variables though but still don't get stored in $_SESSION. If 
>> I'm correct, this may implies that it is apache that is faulty right?
>> 
>> 
>> 
>> $_GET['push'] will be undefined if you still have your session stored, but 
>> accessing the script directly. It should have nothing to do with faulty 
>> Apache. 
> 
> Okay, let me paraphrase: when I run the ping pong scripts written up there, I 
> have a blank in var_dump($_SESSION) if and only if I have 
> 
> [Mon Mar 18 13:25:37 2013] [error] [client 184.151.114.111] PHP Notice:  
> Undefined index: push in 
> /home/www/www.ngenioconnect.com/Modules/MPOSurveyTest/pong.php on line 8
> 
> on apache log. So my question really is, it is apache that handles the posts 
> and gets requests, as I use both and it seems that the non-persistence of 
> data occurs before the storage in $_SESSION, is it possible that it is Apache 
> that is faulty?
Er… I looked where it caused a problem, it seems that $_GET, $_POST and 
$_SESSION are indeed all affected. Any clue of a faulty installation that would 
cause problem for many surperglobals? 



--- End Message ---
--- Begin Message ---
Am 18.03.13 19:46, schrieb Éric Oliver Paquette:
> Hi all, 
>
> I'll be swift in my explanation as I can't find in any way the source of the 
> problem; it seems to be installation-related. 
>
> At execution, sometimes (randomly it seems at first), variable session aren't 
> properly stored. 
>
> =====================
>
> First things first, about installation : 
>
> uname -a -m -p yields :
>
> Linux cl-t180-253cl.privatedns.com 2.6.18-308.1.1.el5 #1 SMP Wed Mar 7 
> 04:16:51 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
>
> php -v yields :
>
> PHP 5.3.3 (cli) (built: Jun 27 2012 12:25:48) 
> Copyright (c) 1997-2010 The PHP Group
> Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
>
> =====================
>
> To make sure it is not caused by any other part of my scripts, I just created 
> two scripts that have replicated the problem :
>
> SCRIPT #1 [ping.php] ################
>
> <?php
>
> session_start();
>
> if(count($_SESSION['in'])==0){
>     $_SESSION['in'][0]='0-initiate';
> } else {
>     $_SESSION['in'][] = count($_SESSION['in']).$_GET['push'];
> }
>
> if(count($_SESSION['in'])<1000){
>     $rand = rand(0, 1000000);
>     ?>
>         <meta http-equiv="refresh" content="0;URL='pong.php?push=<?php echo 
> $rand; ?>'">
>     <?php
> } else {
>     var_dump($_SESSION);
> }
>
> ?>
>
> SCRIPT #2 [pong.php] ################ 
>
> <?php
>
> session_start();
>
> if(count($_SESSION['in'])==0){
>     $_SESSION['in'][0]='0-initiate';
> } else {
>     $_SESSION['in'][] = count($_SESSION['in']).$_GET['push'];
> }
>
> if(count($_SESSION['in'])<1000){
>     $rand = rand(0, 1000000);
>     ?>
>         <meta http-equiv="refresh" content="0;URL='ping.php?push=<?php echo 
> $rand; ?>'">
>     <?php
> } else {
>     var_dump($_SESSION);
> }
>
> ?>
>
> ##################################
>
> In fact, when I run this on my server I randomly have empty entries in the 
> $_SESSION array. Any thoughts on this? Is this a known bug (haven't found it…)
>
> Thanks!

Just a thought that came to my mind: Have you disabled browser caching?

And about the "push" is undefined in the logs: How do you call the
script for the first time? With or with push parameter?

-- 
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz


Attachment: signature.asc
Description: OpenPGP digital signature


--- End Message ---
--- Begin Message ---
My webcode written in PHP and it is running in the interpreted way. My problem 
is it is not giving the desired performance so want to try the compiler if any. 
Please suggest if we have any compiler option available for the PHP code and 
more important is this new option.


--- End Message ---

Reply via email to