[PHP] PHP CLI Forking Problem

2004-10-22 Thread John McKerrell
Hi,
   We've got a script setup that forks a number of child processes,
using pcntl_fork. When a child finishes we capture the SIGCHLD, do
pcntl_wait, and then fork of another child. This has worked fine in one
script but now using exactly the same forking code in another script has
resulted in problems.
   Now it seems, the child will get to the exit but the exit function
will not actually complete. I'm not sure what's likely to be causing
this, I was wondering if the child was waiting for the parent to finish
with resources perhaps? But the other forking script has similar
resources setup too. I tried stracing the running child process and got
nothing out. I tried gdb on the running process and got the following:
q = p;
(gdb)
554 p = p->pListNext;
(gdb)
555 if (ht->pDestructor) {
(gdb)
556 ht->pDestructor(q->pData);
(gdb)
558 if (!q->pDataPtr && q->pData) {
(gdb)
561 pefree(q, ht->persistent);
(gdb)
555 if (ht->pDestructor) {

Basically it's looping on those commands over and over... Now I think
about it that could just be it freeing up each individual allocated bit
of memory, but I've left it running for ten minutes and the children
still didn't manage to finish. Anyone got any thoughts?
Thanks,
John McKerrell

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



[PHP] Dynamic vs Static Builds

2004-02-05 Thread John McKerrell
Hi,
   I've been working with a PHP for a few years now. I've always thought
that on production servers, to have them working at peak efficiency, I
should have the Apache and PHP compiled as a static build. I recently
got into a debate with someone over whether this had any worthwhile
savings. Can anyone tell me which is the best solution, or point me in
the direction of a solution? I realise that it would vary from situation
to situation, so I'll tell you that my situation is high load servers
required to run as fast as possible. They get restarted once a day, and
(ideally) only get php+apache rebuilt when there's new versions out.
Thanks for any advice you can offer,
John

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



Re: [PHP] How to search for a date

2004-02-05 Thread John McKerrell
For MySQL you're still going to need NOW() instead of CURRENT_DATE
though surely? 
John

On Thu, 2004-02-05 at 15:57, John W. Holmes wrote:
> From: "Brian Dunning" <[EMAIL PROTECTED]>
> Subject: [PHP] How to search for a date
> 
> A date? Well, you could try Friendster or orkut to find date, or... oh
> wait...
> 
> > Sorry this is such a basic question - but I couldn't find it online.
> >
> > I have a date field in MySQL: -00-00. I'm trying to insert or
> > search for the current date, and I can't find the way to state that in
> > the SQL. This is wrong, can someone please tell me what's correct?
> >
> >INSERT INTO mytable (dateField) VALUE (CURRENT_DATE);
> >
> >SELECT * FROM mytable WHERE dateField = CURRENT_DATE;
> 
> Sucks how missing one letter will jack things up.
> 
> INSERT INTO mytable (dateField) VALUES (CURRENT_DATE);
> 
> Missing the S in values. That'll cause you first query to fail which will
> cause your second query to fail since there's no matching row. :)
> 
> ---John Holmes...

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



Re: [PHP] How to search for a date

2004-02-05 Thread John McKerrell
apologies
* scurries away and hides in a hole ;)

John

On Thu, 2004-02-05 at 16:16, John W. Holmes wrote:
> From: "John McKerrell" <[EMAIL PROTECTED]>
> 
> > > INSERT INTO mytable (dateField) VALUES (CURRENT_DATE);
> 
> > For MySQL you're still going to need NOW() instead of CURRENT_DATE
> > though surely? 
> 
> No. He has a DATE column, so why use NOW() which includes time informatin. 
> 
> Quote: CURRENT_DATE and CURRENT_DATE() are synonyms for CURDATE(). 
> 
> Take your pick.
> 
> ---John Holmes...

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



Re: [PHP] Dynamic vs Static Builds

2004-02-05 Thread John McKerrell
On Thu, 2004-02-05 at 16:12, vidyut luther wrote:
> Hi John,
> A couple of questions.. 
> 1. Define high load.
Er.. that's quite a personal question, apparently we get 58 million hits
a month but some days will be much busier than others (we're a soccer
site, match days are busiest). The load is split over 6 Dell Poweredge
1550 servers.

> 2. Why are the servers being restarted once a day ? There shouldn't be a
> need to restart unless something is going wrong. 
For cycling the logs, we've got scripts setup to sort them out each day
- backing them up and suchlike, which restart the webserver.

> 
> As for your main question.. I build php as a DSO module basically
> because I don't upgrade my PHP as often or whenever there is a new
> version out, unless it's got security fixes.. and even then I wait for
> everything to be tested. This helps out in the way that I don't have to
> upgrade or recompile two things whenever I want to update php , or
> apache. Secondly, it's easier to disable PHP this way, in case I have
> extremely high traffic and I only want to serve static content. But, to
> each their own.  The main speed/performance difference will come more
> from how you write your code than wether it's dynamically or statically
> built. Also, if you need performance increases, look into Zend
> Accelerator or the ZPS Suite.. (it's kinda expensive, but WELL WORTH THE
> $$). 
> 
> Please note i have no links with Zend other than being a very happy
> customer. 
> 
I get that the code is very important, some bits of our code are great
for efficiency, some less so great, I'm basically looking to squeeze the
best performance out of what we've got. (We use Zend Optimizer, not
tried the Accelerator yet).
John

> On Thu, 2004-02-05 at 09:28, John McKerrell wrote:
> > Hi,
> >I've been working with a PHP for a few years now. I've always thought
> > that on production servers, to have them working at peak efficiency, I
> > should have the Apache and PHP compiled as a static build. I recently
> > got into a debate with someone over whether this had any worthwhile
> > savings. Can anyone tell me which is the best solution, or point me in
> > the direction of a solution? I realise that it would vary from situation
> > to situation, so I'll tell you that my situation is high load servers
> > required to run as fast as possible. They get restarted once a day, and
> > (ideally) only get php+apache rebuilt when there's new versions out.
> > Thanks for any advice you can offer,
> > John

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



[PHP] Sablotron Errors

2001-02-20 Thread John McKerrell

Hi,
   Not sure if this has been covered on here but... In recent versions
PHP/Sablotron I've found that parse errors in the XML/XSL cause fatal
errors. I'd much rather not have this happen so is there a way I can get
around it? I'm doing xslt_process( ... ) which is meant to return false
on errors so how can I get it to do that again rather than generating a
fatal error that stops processing. I've tried putting my own dummy
errorhandler in that doesn't do anything but that won't do it. Can you
help?
  John

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]