php-general Digest 12 Mar 2012 13:38:09 -0000 Issue 7724

Topics (messages 316989 through 316992):

Re: Have little enough hair as it is ...
        316989 by: Matijn Woudt
        316990 by: Lester Caine
        316991 by: Simon Schick
        316992 by: Lester Caine

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 12, 2012 at 12:11 AM, Simon Schick
<simonsimc...@googlemail.com> wrote:
> 2012/3/11 Lester Caine <les...@lsces.co.uk>:
>> ( Been down London over night ;) ) ... and was not awake enough to change
>> email address ...
>>
>>
>>> http://piwik.medw.org.uk/phpinfo.php has http://piwik.medw.org.uk/ working
>>> fine...
>>>
>>> http://piwik.rainbowdigitalmedia.org.uk/phpinfo.php is just giving seg
>>> faults on http://piwik.rainbowdigitalmedia.org.uk/ but
>>> http://rainbowdigitalmedia.org.uk/ is working perfectly.
>>>
>>> The piwik analytics is based on Zend, and I've not been able to get it
>>> working on either of the two new machines, while all of my other stuff is
>>> working fine. I started with Apache2.4.1 and PHP5.4.0 and moved back to
>>> what
>>> should be the same versions as the working machines but without success.
>>
>>
>> Simon Schick wrote:
>>>
>>> Can you give us some more information?
>>
>> I've been working on this for some days and tried various combinations of
>> Apache and PHP, but my starting point was Ap2.4.1 with PHP5.4.0 and I've now
>> worked my way back through versions to what should be the same as setup as
>> is working on piwik.medw.org.uk but I have yet to get piwik to run on either
>> new machine!
>>
>>> How is php called in your apache-configuration? (f)cgi, module or somehow
>>> else?
>>> You said that the configuration should be the same ... can you
>>> double-check that? Reload the services etc ...
>>
>> Always used module and I see no reason to change
>> I've enabled and disable just about everything, and the installer tells me
>> the set-up is fine.
>>
>>> What about the logs? There must be more info in there ...
>>
>> THAT is what is pissing me off. ZEND does not seem to log anything usable
>> and I have yet to establish the best way of debugging it. The rest of my
>> stuff simply worked, gave the expected new nagging and allowed me to track
>> and tidy them. EVERY configuration of ZEND based piwik just gives ...
>> [notice] child pid 10345 exit signal Segmentation fault (11)
>> With eaccelerator switched on and tracking, I can see files being cached,
>> but have yet to work out what the next file would be, and to be honest, I'm
>> not convinced it runs the same way every time, but that is probably just the
>> order of parallel paths being run?
>>
>> --
>> Lester Caine - G8HFL
>> -----------------------------
>> Contact - http://lsces.co.uk/wiki/?page=contact
>> L.S.Caine Electronic Services - http://lsces.co.uk
>> EnquirySolve - http://enquirysolve.com/
>> Model Engineers Digital Workshop - http://medw.co.uk//
>> Firebird - http://www.firebirdsql.org/index.php
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
> Hi, Lester
>
> You're talking about some kind of "installer" ... What exactly is it?
> And what exactly do you mean with "ZEND does not seem to log ..."?
> Apache, PHP or something that's controlling both?
> And the more interesting question as you're only talking about ZEND
> ... in which log-file have you found the notice? I guess it's the
> log-file of Apache ...
> I guess you have already tried to set Apache and PHP to the lowest
> possible error-level ...
>
> I searched up the inet and came across totally different solutions ...
>
> Things that I found you can try:
> * Replace the index.php ... Some people reported that this error was
> caused by an endless-loop in their php-script

I have experienced a segfault once with mod_rewrite and some endless
loop in a .htaccess file. So you might want to check that too.

- Matijn

--- End Message ---
--- Begin Message ---
Matijn Woudt wrote:
>  Things that I found you can try:
>  * Replace the index.php ... Some people reported that this error was
>  caused by an endless-loop in their php-script
I have experienced a segfault once with mod_rewrite and some endless
loop in a .htaccess file. So you might want to check that too.

Thanks for the hints guys, but it was the wrong direction ...
piwik is an analytics package ... google analytics with steroids ;)
But the code base is a bit difficult to work with when one does not use frameworks like Zend.

The starting point was a segfault in PHP which needs to be fixed, but we normally manage to avoid hitting it by managing things better. The updates I'd added to the Firebird driver in Zend were missing some checks which kicked it out at which point ... NOTHING gets logged.

In 12 years I've managed to avoid having to install xdebug as we have all the debug tools I need in the bitweaver framework. I've grabbed a nightly build from Derick which I needed to work on PHP5.4 and managed to dump the traces to nail down where the problem arose. I'm not sure why there is a difference between the working machines and the problem ones, but the fixes have now allowed me to get the code running, so I can then finish debugging 'in-line' which I'm used to.

Next step is to move back to Apache 2.4.1 since I'm still on 2.2 but at least now I do have the tools if the problem returns then.

More irritating is
'Notice: Array to string conversion' which are coming up all over the place. I can understand what the problem is ... but trying to remove the notices is more challenging ...

$secondsGap[] = array($gap[0] * 60, $gap[1] * 60);
if( isset($secondsGap[1]) ) {
        $gapName = $secondsGap[0]."to".$secondsGap[1];
} else {
        $gapName = $secondsGap[0];
}
$secondsGap[] is two numbers, which are used to create the name string, so what is the 'official' way of making this work without generating warnings?

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
2012/3/12 Lester Caine <les...@lsces.co.uk>:
> More irritating is
> 'Notice: Array to string conversion' which are coming up all over the place.
> I can understand what the problem is ... but trying to remove the notices is
> more challenging ...
>
> $secondsGap[] = array($gap[0] * 60, $gap[1] * 60);
> if( isset($secondsGap[1]) ) {
>        $gapName = $secondsGap[0]."to".$secondsGap[1];
> } else {
>        $gapName = $secondsGap[0];
> }
> $secondsGap[] is two numbers, which are used to create the name string, so
> what is the 'official' way of making this work without generating warnings?
>

Hi, Lester

I suggest that all done with this variable before is not of interest ...
Assuming this, I'd say the following:

> $secondsGap[] = array($gap[0] * 60, $gap[1] * 60);
Implicit initializing of an array that has the following structure:
array( array(int, int) );

> if( isset($secondsGap[1]) ) {
Trying to get the second element .. which will never happen if you
haven't added an element before the snipped you pasted here.

>        $gapName = $secondsGap[0]."to".$secondsGap[1];
> } else {
>        $gapName = $secondsGap[0];
> }
[some-code]

I'm quite unsure what you want to do here. If you'd update the first
line as following it would always trigger the first condition:
$secondsGap = array($gap[0] * 60, $gap[1] * 60);

Bye
Simon

--- End Message ---
--- Begin Message ---
Simon Schick wrote:
I suggest that all done with this variable before is not of interest ...
Assuming this, I'd say the following:

>  $secondsGap[] = array($gap[0] * 60, $gap[1] * 60);
Implicit initializing of an array that has the following structure:
array( array(int, int) );

OK $gap comes from the loop
foreach(self::$timeGap as $gap)
self::$timeGap is a list of pairs of numbers.

>  if( isset($secondsGap[1]) ) {
Trying to get the second element .. which will never happen if you
haven't added an element before the snipped you pasted here.

>          $gapName = $secondsGap[0]."to".$secondsGap[1];
>  } else {
>          $gapName = $secondsGap[0];
>  }
[some-code]

I'm quite unsure what you want to do here. If you'd update the first
line as following it would always trigger the first condition:
$secondsGap = array($gap[0] * 60, $gap[1] * 60);
What this code is doing perfectly in PHP5.3 is generating the text string to display for each time period listed in the array of pairs of numbers ( some with a 'blank' second number and what the code returns is a string of the format '(number1)to(number2)' or simply '(number1)' - something fairly standard in PHP? But the nanny message says it need to be re-writen, the question is 'How?' :(

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---

Reply via email to