Re: [PHP] Command line PHP

2011-01-11 Thread David Harkness
On Tue, Jan 11, 2011 at 10:12 AM, tedd wrote: > My down time is playing XBOX Black Ops. It allows my mind to focus on > things that don't matter, much like a vacation, that's frees space > For me that's Left 4 Dead 2 as Captain Cujo. I think it's beneficial to cultivate skills in something that

Re: [PHP] Command line PHP

2011-01-11 Thread Richard Quadling
On 11 January 2011 17:53, Robert Cummings wrote: > On 11-01-11 12:14 PM, Donovan Brooke wrote: >> >> tedd wrote: >>> >>> At 1:54 PM -0500 1/7/11, Joshua Kehn wrote: Why should someone stop learning ever? >>> >>> Because my head fills up. >>> >>> I have to wait until I forget something be

Re: [PHP] Command line PHP

2011-01-11 Thread tedd
At 11:14 AM -0600 1/11/11, Donovan Brooke wrote: tedd wrote: At 1:54 PM -0500 1/7/11, Joshua Kehn wrote: Why should someone stop learning ever? Because my head fills up. I have to wait until I forget something before I can learn something new. The up-side is that I'm learning something new

Re: [PHP] Command line PHP

2011-01-11 Thread Robert Cummings
On 11-01-11 12:14 PM, Donovan Brooke wrote: tedd wrote: At 1:54 PM -0500 1/7/11, Joshua Kehn wrote: Why should someone stop learning ever? Because my head fills up. I have to wait until I forget something before I can learn something new. The up-side is that I'm learning something new almos

Re: [PHP] Command line PHP

2011-01-11 Thread Donovan Brooke
tedd wrote: At 1:54 PM -0500 1/7/11, Joshua Kehn wrote: Why should someone stop learning ever? Because my head fills up. I have to wait until I forget something before I can learn something new. The up-side is that I'm learning something new almost every day now. Cheers, tedd lol.. I ju

Re: [PHP] Command line PHP

2011-01-11 Thread Richard Quadling
On 11 January 2011 16:59, Robert Cummings wrote: > Doh, that sucks! Yep. The common solution I've seen is to have a separate thread running to read from the stream/buffer the content (and suffer the blocking) and the main thread to simply return the data from the the buffer or nothing if there is

Re: [PHP] Command line PHP

2011-01-11 Thread Robert Cummings
On 11-01-11 11:55 AM, Richard Quadling wrote: On 11 January 2011 16:43, Robert Cummings wrote: On 11-01-11 11:27 AM, Richard Quadling wrote: As PHP on windows requires an [ENTER] key to be pressed to pass the typed string to the code (even for fgetc(STDIN) ), then this may not be what you wan

Re: [PHP] Command line PHP

2011-01-11 Thread Richard Quadling
On 11 January 2011 16:43, Robert Cummings wrote: > On 11-01-11 11:27 AM, Richard Quadling wrote: >> >> As PHP on windows requires an [ENTER] key to be pressed to pass the >> typed string to the code (even for fgetc(STDIN) ), then this may not >> be what you want. > > Have you tried setting the str

Re: [PHP] Command line PHP

2011-01-11 Thread Richard Quadling
On 11 January 2011 16:43, Robert Cummings wrote: > On 11-01-11 11:27 AM, Richard Quadling wrote: >> >> As PHP on windows requires an [ENTER] key to be pressed to pass the >> typed string to the code (even for fgetc(STDIN) ), then this may not >> be what you want. > > Have you tried setting the str

Re: [PHP] Command line PHP

2011-01-11 Thread Robert Cummings
On 11-01-11 11:27 AM, Richard Quadling wrote: As PHP on windows requires an [ENTER] key to be pressed to pass the typed string to the code (even for fgetc(STDIN) ), then this may not be what you want. Have you tried setting the stream to non-blocking to prevent the need for the return key? C

Re: [PHP] Command line PHP

2011-01-11 Thread Richard Quadling
On 7 January 2011 16:55, la...@garfieldtech.com wrote: > Hi folks.  I have a project coming up that will involve writing a > non-trivial command line PHP application.  Most of it will be nice and > abstracted and standalone and all of that jazz, but it will need to do > command line interation.  I

Re: [PHP] Command line PHP

2011-01-08 Thread Daniel Brown
On Sat, Jan 8, 2011 at 00:23, Larry Garfield wrote: > On Friday, January 07, 2011 9:34:42 pm David Hutto wrote: > >> Which yielded this as the first result: >> >> >> http://php.net/manual/en/features.commandline.php > > As noted in my original email, I find the native SAPI clunky and difficult to

Re: [PHP] Command line PHP

2011-01-08 Thread Daniel Brown
On Sat, Jan 8, 2011 at 07:25, TR Shaw wrote: > > Sorry, David I should not reply quickly when I have a cold but again its all > pretty similar. Here it is on unix/linux. > > PHP: > > $word = "hello"; > exec("say \"$word\""); > > Bash: > > word="hello" > say "$word" -- Network Infrastructure

Re: [PHP] Command line PHP

2011-01-08 Thread Lester Caine
David Hutto wrote: I'm with some of the others above on using Python. Writing a command line app is about as simple as: snip I think of PHP as more browser, than desktop app/webapp. The point I was trying to make was one where there are two paths to doing the same job ... Example Thumbnail

Re: [PHP] Command line PHP

2011-01-08 Thread David Hutto
Like i said, my introduction to php is browser,and desktop app is python, but I will try php in the command line out. 1) set a variable 2) call an external program with the variable as an argument this is something I recognize very well:) -- PHP General Mailing List (http://www.php.net/) To uns

Re: [PHP] Command line PHP

2011-01-08 Thread TR Shaw
On Jan 7, 2011, at 8:50 PM, David Hutto wrote: > On Fri, Jan 7, 2011 at 8:44 PM, TR Shaw wrote: >> >> On Jan 7, 2011, at 8:36 PM, David Hutto wrote: >> >>> I'm with some of the others above on using Python. Writing a command >>> line app is about as simple as: >>> >>> import subprocess >>> wo

Re: [PHP] Command line PHP

2011-01-07 Thread David Hutto
I could go yoda, but suffice it to say, "From The Language Speaks The Soul Of The Man's Design". -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Command line PHP

2011-01-07 Thread Larry Garfield
On Friday, January 07, 2011 9:34:42 pm David Hutto wrote: > Which yielded this as the first result: > > > http://php.net/manual/en/features.commandline.php As noted in my original email, I find the native SAPI clunky and difficult to work with. Hence I was looking for something more usable an

Re: [PHP] Command line PHP

2011-01-07 Thread David Hutto
There have been a lot of responses, but this might be the best place to start: http://www.google.com/search?client=ubuntu&channel=fs&q=command+line+PHP+application.&ie=utf-8&oe=utf-8 Which yielded this as the first result: http://php.net/manual/en/features.commandline.php -- PHP General Mail

Re: [PHP] Command line PHP

2011-01-07 Thread David Hutto
I'm with some of the others above on using Python. Writing a command line app is about as simple as: import subprocess word = 'hello' self.espeak = subprocess.Popen(['espeak', word], stdout = subprocess.PIPE).communicate()[0] I think of PHP as more browser, than desktop app/webapp. -- PHP Gener

Re: [PHP] Command line PHP

2011-01-07 Thread Lester Caine
Joshua Kehn wrote: why bother learning 2 languages when 1 will suit most needs perfectly? for most folks who work with the web and a typical deployment environment like a linux server, the second language of choice most likely would be a client side one like javascript. > You can't say that

Re: [PHP] Command line PHP

2011-01-07 Thread Nathan Nobbe
On Fri, Jan 7, 2011 at 2:52 PM, tedd wrote: > At 1:24 PM -0700 1/7/11, Nathan Nobbe wrote: > >> On Fri, Jan 7, 2011 at 12:53 PM, tedd < >> tedd.sperl...@gmail.com> wrote: >> much of the gripe comparing php to python >> >> -nathan >> > > I try to stay away from snak

Re: [PHP] Command line PHP

2011-01-07 Thread tedd
At 3:05 PM -0500 1/7/11, Robert Cummings wrote: Is the winner JavaScript? *ducks and runs* Rob. Careful or I'll have to fog you as well. :-) Cheers, tedd -- --- http://sperling.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.ph

Re: [PHP] Command line PHP

2011-01-07 Thread tedd
At 1:24 PM -0700 1/7/11, Nathan Nobbe wrote: On Fri, Jan 7, 2011 at 12:53 PM, tedd <tedd.sperl...@gmail.com> wrote: much of the gripe comparing php to python -nathan I try to stay away from snakes. Cheers, tedd -- --- http://sperling.com/ -- PHP General

Re: [PHP] Command line PHP

2011-01-07 Thread Nicholas Kell
On Jan 7, 2011, at 1:34 PM, TR Shaw wrote: > > On Jan 7, 2011, at 12:08 PM, Nicholas Kell wrote: > >> >> On Jan 7, 2011, at 11:01 AM, Joshua Kehn wrote: >> >>> On Jan 7, 2011, at 11:55 AM, la...@garfieldtech.com wrote: >>> Hi folks. I have a project coming up that will involve writing

Re: [PHP] Command line PHP

2011-01-07 Thread Robert Cummings
On 11-01-07 03:24 PM, Nathan Nobbe wrote: much of the gripe comparing php to python over the years is slowly fading with the advent of new features of php, most notably closures. once traits are available im sure the multiple inheritance that python offers will be less of an advantage over php's

Re: [PHP] Command line PHP

2011-01-07 Thread Nathan Nobbe
On Fri, Jan 7, 2011 at 12:53 PM, tedd wrote: > At 12:16 PM -0700 1/7/11, Nathan Nobbe wrote: > >> On Fri, Jan 7, 2011 at 11:54 AM, Joshua Kehn wrote: >> >> Why bother learning other languages? Is this a joke? Why should someone >>> stop learning *ever?** *Having a mastery of multiple language

Re: [PHP] Command line PHP

2011-01-07 Thread Robert Cummings
On 11-01-07 02:53 PM, tedd wrote: At 12:16 PM -0700 1/7/11, Nathan Nobbe wrote: On Fri, Jan 7, 2011 at 11:54 AM, Joshua Kehn wrote: Why bother learning other languages? Is this a joke? Why should someone stop learning *ever?** *Having a mastery of multiple languages can only enhance you

Re: [PHP] Command line PHP

2011-01-07 Thread tedd
At 12:16 PM -0700 1/7/11, Nathan Nobbe wrote: On Fri, Jan 7, 2011 at 11:54 AM, Joshua Kehn wrote: Why bother learning other languages? Is this a joke? Why should someone stop learning *ever?** *Having a mastery of multiple languages can only enhance you. No, it's not a joke. The idea is

Re: [PHP] Command line PHP

2011-01-07 Thread tedd
At 1:54 PM -0500 1/7/11, Joshua Kehn wrote: Why should someone stop learning ever? Because my head fills up. I have to wait until I forget something before I can learn something new. The up-side is that I'm learning something new almost every day now. Cheers, tedd -- --- http://sperli

Re: [PHP] Command line PHP

2011-01-07 Thread Robert Cummings
On 11-01-07 02:33 PM, Robert Cummings wrote: On 11-01-07 11:55 AM, la...@garfieldtech.com wrote: Hi folks. I have a project coming up that will involve writing a non-trivial command line PHP application. Most of it will be nice and abstracted and standalone and all of that jazz, but it will ne

Re: [PHP] Command line PHP

2011-01-07 Thread tedd
At 11:48 AM -0700 1/7/11, Nathan Nobbe wrote: why bother learning 2 languages when 1 will suit most needs perfectly? for most folks who work with the web and a typical deployment environment like a linux server, the second language of choice most likely would be a client side one like javascrip

Re: [PHP] Command line PHP

2011-01-07 Thread Ashley Sheridan
On Fri, 2011-01-07 at 11:31 -0800, David Harkness wrote: > On Fri, Jan 7, 2011 at 10:41 AM, la...@garfieldtech.com < > la...@garfieldtech.com> wrote: > > > "Application" is perhaps a misnomer. I'm not looking at rewriting Emacs or > > anything. Just some batch processing that would get run as:

Re: [PHP] Command line PHP

2011-01-07 Thread TR Shaw
On Jan 7, 2011, at 12:08 PM, Nicholas Kell wrote: > > On Jan 7, 2011, at 11:01 AM, Joshua Kehn wrote: > >> On Jan 7, 2011, at 11:55 AM, la...@garfieldtech.com wrote: >> >>> Hi folks. I have a project coming up that will involve writing a >>> non-trivial command line PHP application. Most of

Re: [PHP] Command line PHP

2011-01-07 Thread Robert Cummings
On 11-01-07 11:55 AM, la...@garfieldtech.com wrote: Hi folks. I have a project coming up that will involve writing a non-trivial command line PHP application. Most of it will be nice and abstracted and standalone and all of that jazz, but it will need to do command line interation. I'm not sur

Re: [PHP] Command line PHP

2011-01-07 Thread David Harkness
On Fri, Jan 7, 2011 at 10:41 AM, la...@garfieldtech.com < la...@garfieldtech.com> wrote: > "Application" is perhaps a misnomer. I'm not looking at rewriting Emacs or > anything. Just some batch processing that would get run as: > > php myscript.php --config=foo.xml --setting-1=stuff For this I

Re: [PHP] Command line PHP

2011-01-07 Thread Joshua Kehn
On Jan 7, 2011, at 1:41 PM, la...@garfieldtech.com wrote: > "Application" is perhaps a misnomer. I'm not looking at rewriting Emacs or > anything. Just some batch processing that would get run as: > > php myscript.php --config=foo.xml --setting-1=stuff > > And then it will run off and move a

Re: [PHP] Command line PHP

2011-01-07 Thread Nathan Nobbe
On Fri, Jan 7, 2011 at 11:54 AM, Joshua Kehn wrote: > On Jan 7, 2011, at 1:48 PM, Nathan Nobbe wrote: > > shrug, you must not be too familiar with php then. 9 times out of 10 it's > the natural, perfect choice for a cli program. there are situations where > you get past what php is ideal for on

Re: [PHP] Command line PHP

2011-01-07 Thread Robert Cummings
On 11-01-07 01:31 PM, Joshua Kehn wrote: On Jan 7, 2011, at 12:34 PM, Daniel Brown wrote: On Fri, Jan 7, 2011 at 12:18, Joshua Kehn wrote: Using another language more suited towards CLI / standalone (non-web) development would be easier. PHP at it's core is a templating language. I don't t

Re: [PHP] Command line PHP

2011-01-07 Thread David Harkness
On Fri, Jan 7, 2011 at 10:31 AM, Joshua Kehn wrote: > My apologies. I just view PHP as a perfected web language, due to it's > templating nature, while using it for other things (scripts, utilities, > cron) is a misuse in my opinion. > Even if you are proficient in more "CLI-appropriate" languag

Re: [PHP] Command line PHP

2011-01-07 Thread la...@garfieldtech.com
On 1/7/11 11:08 AM, Nicholas Kell wrote: On Jan 7, 2011, at 11:01 AM, Joshua Kehn wrote: On Jan 7, 2011, at 11:55 AM, la...@garfieldtech.com wrote: Hi folks. I have a project coming up that will involve writing a non-trivial command line PHP application. Most of it will be nice and abstra

Re: [PHP] Command line PHP

2011-01-07 Thread Daniel Brown
On Fri, Jan 7, 2011 at 13:31, Joshua Kehn wrote: > > My apologies. I just view PHP as a perfected web language, due to it's > templating nature, while using it for other things (scripts, utilities, > cron) is a misuse in my opinion. No one ever needs to apologize for their opinion, Josh, no w

Re: [PHP] Command line PHP

2011-01-07 Thread Joshua Kehn
On Jan 7, 2011, at 1:53 PM, Ashley Sheridan wrote: > There's no real reason why you shouldn't use PHP for cli apps, it has a lot > of features specifically intended for it even. I've found it to be fast > enough for my needs, it's familiar, and I don't need to compile an app every > time I make

Re: [PHP] Command line PHP

2011-01-07 Thread Joshua Kehn
On Jan 7, 2011, at 1:48 PM, Nathan Nobbe wrote: > shrug, you must not be too familiar with php then. 9 times out of 10 it's > the natural, perfect choice for a cli program. there are situations where > you get past what php is ideal for on the cli, typically when you get into > heavy forking

Re: [PHP] Command line PHP

2011-01-07 Thread Ashley Sheridan
On Fri, 2011-01-07 at 13:31 -0500, Joshua Kehn wrote: > On Jan 7, 2011, at 12:34 PM, Daniel Brown wrote: > > > On Fri, Jan 7, 2011 at 12:18, Joshua Kehn wrote: > >> > >> Using another language more suited towards CLI / standalone (non-web) > >> development would be easier. PHP at it's core is

Re: [PHP] Command line PHP

2011-01-07 Thread Nathan Nobbe
On Fri, Jan 7, 2011 at 11:31 AM, Joshua Kehn wrote: > On Jan 7, 2011, at 12:34 PM, Daniel Brown wrote: > > > On Fri, Jan 7, 2011 at 12:18, Joshua Kehn wrote: > >> > >> Using another language more suited towards CLI / standalone (non-web) > development would be easier. PHP at it's core is a templ

Re: [PHP] Command line PHP

2011-01-07 Thread Joshua Kehn
On Jan 7, 2011, at 12:34 PM, Daniel Brown wrote: > On Fri, Jan 7, 2011 at 12:18, Joshua Kehn wrote: >> >> Using another language more suited towards CLI / standalone (non-web) >> development would be easier. PHP at it's core is a templating language. I >> don't think it is as suited as say Pyt

Re: [PHP] Command line PHP

2011-01-07 Thread Andy McKenzie
On Fri, Jan 7, 2011 at 11:55 AM, la...@garfieldtech.com wrote: > Hi folks.  I have a project coming up that will involve writing a > non-trivial command line PHP application.  Most of it will be nice and > abstracted and standalone and all of that jazz, but it will need to do > command line intera

Re: [PHP] Command line PHP

2011-01-07 Thread Daniel Brown
On Fri, Jan 7, 2011 at 12:18, Joshua Kehn wrote: > > Using another language more suited towards CLI / standalone (non-web) > development would be easier. PHP at it's core is a templating language. I > don't think it is as suited as say Python for developing standalone > applications. One m

Re: [PHP] Command line PHP

2011-01-07 Thread Joshua Kehn
On Jan 7, 2011, at 12:12 PM, Daniel Brown wrote: > On Fri, Jan 7, 2011 at 12:01, Joshua Kehn wrote: >> >> Why are you writing a command line application in PHP? I would think that is >> starting off on a very wrong foot. > >I would not be exaggerating to say that I've written over a > thou

Re: [PHP] Command line PHP

2011-01-07 Thread a...@ashleysheridan.co.uk
(sorry for top post, still not worked out how not to on phone) Can you not just code it like you normally would any app that doesn't use a framework? I've been writing some cli data importers at work. Basic really, with only classes used that I need, no framework needed (its very simple) and al

Re: [PHP] Command line PHP

2011-01-07 Thread Daniel Brown
On Fri, Jan 7, 2011 at 12:01, Joshua Kehn wrote: > > Why are you writing a command line application in PHP? I would think that is > starting off on a very wrong foot. I would not be exaggerating to say that I've written over a thousand command line applications in PHP since about 2003. For

Re: [PHP] Command line PHP

2011-01-07 Thread Nicholas Kell
On Jan 7, 2011, at 11:01 AM, Joshua Kehn wrote: > On Jan 7, 2011, at 11:55 AM, la...@garfieldtech.com wrote: > >> Hi folks. I have a project coming up that will involve writing a >> non-trivial command line PHP application. Most of it will be nice and >> abstracted and standalone and all of

Re: [PHP] Command line PHP

2011-01-07 Thread Daniel Brown
On Fri, Jan 7, 2011 at 11:55, la...@garfieldtech.com wrote: > Hi folks.  I have a project coming up that will involve writing a > non-trivial command line PHP application.  Most of it will be nice and > abstracted and standalone and all of that jazz, but it will need to do > command line interatio

Re: [PHP] Command line PHP

2011-01-07 Thread Joshua Kehn
On Jan 7, 2011, at 11:55 AM, la...@garfieldtech.com wrote: > Hi folks. I have a project coming up that will involve writing a non-trivial > command line PHP application. Most of it will be nice and abstracted and > standalone and all of that jazz, but it will need to do command line > interat

RE: [PHP] Command-line PHP memory limit

2008-06-12 Thread Boyd, Todd M.
> -Original Message- > From: Shawn McKenzie [mailto:[EMAIL PROTECTED] > Sent: Thursday, June 12, 2008 11:06 AM > To: php-general@lists.php.net > Subject: Re: [PHP] Command-line PHP memory limit > > Per Jessen wrote: > > Rene Fournier wrote: > > > >

Re: [PHP] Command-line PHP memory limit

2008-06-12 Thread Shawn McKenzie
Per Jessen wrote: Rene Fournier wrote: Is it possible to set a unique memory limit for PHP scripts that are run from the command line? (That is, different from what's specified in php.ini.) This might specific to openSUSE, but the typical installation comes with separate php.inis for apache a

Re: [PHP] Command-line PHP memory limit

2008-06-11 Thread Per Jessen
Rene Fournier wrote: > Is it possible to set a unique memory limit for PHP scripts that are > run from the command line? (That is, different from what's specified > in php.ini.) This might specific to openSUSE, but the typical installation comes with separate php.inis for apache and cli. /etc/p

Re: [PHP] Command-line PHP memory limit

2008-06-11 Thread Robert Cummings
On Wed, 2008-06-11 at 23:48 +0200, Rene Fournier wrote: > Is it possible to set a unique memory limit for PHP scripts that are > run from the command line? (That is, different from what's specified > in php.ini.) In your script: ini_set( 'memory_limit', -1 ); Cheers, Rob. -- http://www.

Re: [PHP] MySQL to blame? (was Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?)

2008-01-02 Thread Chris
M5 wrote: On 20-Dec-07, at 1:17 AM, Per Jessen wrote: René Fournier wrote: I'm really not sure what to try next. ps -aux shows MySQL as hogging the CPU, not PHP or Terminal: When this happens, do a 'SHOW PROCESSLIST' in mysql to see what it's doing. I have, and I can't see anything unusu

[PHP] MySQL to blame? (was Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?)

2007-12-20 Thread M5
On 20-Dec-07, at 1:17 AM, Per Jessen wrote: René Fournier wrote: I'm really not sure what to try next. ps -aux shows MySQL as hogging the CPU, not PHP or Terminal: When this happens, do a 'SHOW PROCESSLIST' in mysql to see what it's doing. I have, and I can't see anything unusual. There a

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-20 Thread Per Jessen
René Fournier wrote: > I'm really not sure what to try next. ps -aux shows MySQL as hogging > the CPU, not PHP or Terminal: When this happens, do a 'SHOW PROCESSLIST' in mysql to see what it's doing. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-19 Thread René Fournier
On 11-Dec-07, at 2:13 PM, Per Jessen wrote: René Fournier wrote: However, the number of socket clients connecting in the past 3-4 months has steadily increased, and this seems to have exposed (if not created) a strange performance "issue" with PHP 5.2.4, MySQL 5.0.45 and/or Mac OS X Server 10

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-12 Thread Per Jessen
Jochem Maas wrote: >> Have you tried stracing it to see what's really happening when the >> load goes that high? > > am I correct that that would be done like so?: > > strace -p Yep, that's it. You'll probably want to record the output for analysis, but sometimes it's very obvious what's happ

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread Jochem Maas
Per Jessen wrote: > René Fournier wrote: > >> However, the number of socket clients connecting in the past 3-4 >> months has steadily increased, and this seems to have exposed (if not >> created) a strange performance "issue" with PHP 5.2.4, MySQL 5.0.45 >> and/or Mac OS X Server 10.4.11. (I say "

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread Per Jessen
René Fournier wrote: > However, the number of socket clients connecting in the past 3-4 > months has steadily increased, and this seems to have exposed (if not > created) a strange performance "issue" with PHP 5.2.4, MySQL 5.0.45 > and/or Mac OS X Server 10.4.11. (I say "and/or" because I am unsur

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread René Fournier
That makes sense, but I'm not sure I really want to do this, since it's fairly important that Listener continue listening without interruption. I also don't think it's probably necessary, since from what I read, I'm not really pushing the envelope in terms of real load. Right now, I might

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread Per Jessen
Jochem Maas wrote: >> I'd be interested to see how he does the multi-threading in php. >> Personally I'd always opt for C to write this type of thing, except >> for perhaps the most simple cases. >> > > any chance of an example from you too? Sure - http://jessen.ch/files/distripg_main.c It c

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread Jochem Maas
Per Jessen wrote: > Jochem Maas wrote: > >> Nathan Rixham wrote: >>> Key I find though is multithreading, listener thread with >>> stream_socket_server, 2 or 3 stream_socket_accept threads and a pair >>> of new thread spawned to handle each connection (one to read, one to >>> write) (not needed fo

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread Per Jessen
Jochem Maas wrote: > Nathan Rixham wrote: >> >> Key I find though is multithreading, listener thread with >> stream_socket_server, 2 or 3 stream_socket_accept threads and a pair >> of new thread spawned to handle each connection (one to read, one to >> write) (not needed for stateless http style r

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread Jochem Maas
hi Nathan, any chance of a 'full blown' example for all the muppets who want to try and grok this stuff? (bork bork, say I :-)) Nathan Rixham wrote: > stream_socket_server simply listens, stream_socket_accept handles the > connection, stream_set_write_buffer and stream_set_blocking help you > kee

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread Nathan Rixham
stream_socket_server simply listens, stream_socket_accept handles the connection, stream_set_write_buffer and stream_set_blocking help you keep up, especially when combined with stream_get_line, no need to shile forever when you can just: while (is_resource($conn = stream_socket_accept($socket

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-11 Thread Jim Lucas
M5 wrote: Thanks Jim. No problem. The processing is pretty quick. I don't think that's a bottleneck. It basically just inserts the data into MySQL, not much processing actually. What is the likely hood that two connections would come in at the same time, or at least within close enough

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread M5
Thanks Jim. Several good points here that I will look into. I've already moved the include() bits into function calls. (That's simple thing I should have corrected long ago.) The socket areas though I'm less sure about how to adjust, since networking programming isn't something I grok natur

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread Jim Lucas
René Fournier wrote: FWIW, here's the stripped-down skeleton of the server: As always, constructive criticism is very welcome. $master[] = $socket; $read = $master; $write = $master; while (1) { $read = $master; $write = $master;

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread Jochem Maas
Jochem Maas wrote: > Jim Lucas wrote: >> Tom Rogers wrote: >>> Hi, > > ... > >> Also, make sure you are not using an array that you are not re-initializing >> through each iteration >> of the loop. If the array keeps getting bigger, PHP might $*%& on itself. >> Always re-initialize >> arrays

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread René Fournier
On 10-Dec-07, at 5:20 PM, Jim Lucas wrote: Tom Rogers wrote: Hi, Tuesday, December 11, 2007, 6:42:18 AM, you wrote: RF> Hello, Put a usleep(1000) in the listen while() loop and give the cpu a break. This makes me think about asking if you have to short of a timeout on your receiving conn

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread Jochem Maas
Jim Lucas wrote: > Tom Rogers wrote: >> Hi, ... > Also, make sure you are not using an array that you are not re-initializing > through each iteration > of the loop. If the array keeps getting bigger, PHP might $*%& on itself. > Always re-initialize > arrays to clean them up. even then he ma

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread Jim Lucas
Tom Rogers wrote: > Hi, > > Tuesday, December 11, 2007, 6:42:18 AM, you wrote: > RF> Hello, > > Put a usleep(1000) in the listen while() loop and give the cpu a > break. > This makes me think about asking if you have to short of a timeout on your receiving connection? What are you using to se

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread René Fournier
On 10-Dec-07, at 4:42 PM, Tom Rogers wrote: Put a usleep(1000) in the listen while() loop and give the cpu a break. Good advice, but I've already been doing that. The thing is, when the script first starts up, the CPU rarely exceeds 30%, even when many clients (200+) are simultaneously c

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread Tom Rogers
Hi, Tuesday, December 11, 2007, 6:42:18 AM, you wrote: RF> Hello, RF> I have a command-line PHP script--called Listener--that is designed RF> to run indefinitely with a predictable CPU usage and memory RF> footprint. In a nutshell, it's a multi-client socket server that RF> waits for incomi

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread René Fournier
Hi Jim, I have a server that "listens" like yours does. I get 80k - 85k connections a day to it. When I first started it, I was only getting about 3k of connections aday. Then I upped the listening pattern and it tanked. I noticed that all my mail/web/db connections just sat there.

Re: [PHP] Command-line PHP script CPU usage goes sky-high, stays there--why?

2007-12-10 Thread Jim Lucas
René Fournier wrote: > Hello, > > I have a command-line PHP script--called Listener--that is designed to > run indefinitely with a predictable CPU usage and memory footprint. In a > nutshell, it's a multi-client socket server that waits for incoming > connections, processes incoming data, stores r

Re: [PHP] Command Line PHP Advice

2006-01-29 Thread Nirmalya Lahiri
Angelo, I am very happy after knowing that it is working. :) --Nirmalya Angelo Christou <[EMAIL PROTECTED]> wrote: Hello Nirmalya, Thank you for your response. With the help of your reply, I've now got it working! :) Ang. Nirmalya Lahiri <[EMAIL PROTECTED]> wrote: Hi, you can do th

Re: [PHP] Command Line PHP Advice

2006-01-29 Thread Nirmalya Lahiri
Hi, you can do this by using unix command 'for'. Please apply the command written below & reply me your experiment result. for filename in `ls *.txt`;do ./edit.php $filename var1 var2;done --Nirmalya Angelo Christou <[EMAIL PROTECTED]> wrote: Hello List I would like some advice from PHP us

Re: [PHP] Command Line PHP Advice

2006-01-28 Thread Chris
Angelo Christou wrote: I read that it's better to split scripts up into small reusable parts so my plan is to keep the logic out of the edit.php script and simply pass the variables to it using another script. Am I on the right path doing this? That is a good ideology, but whether it's bes

Re: [PHP] Command-line php in debian/woody

2005-04-06 Thread Robert S
>If you need more recent LAMP stuff on Woody (ex php5) add these lines >in your /etc/apt/sources.list: >deb http://packages.dotdeb.org ./ >deb-src http://sources.dotdeb.org ./ > >This will use recent Debian packages (backported for Woody) >from http://dotdeb.org/ That looks like what I'm after >T

Re: [PHP] Command-line php in debian/woody

2005-04-06 Thread kalinga
just download the php4-cli deb package and install it, i think this should work, and correct me if it's a stupid idea. and Sarge is ok for me, i'm running a production e-mail server for last 6 months with a heavy load on it, i'm using php4-cli on it for my 'home made' exim4 administration utility,

Re: [PHP] Command-line php in debian/woody

2005-04-06 Thread Christophe Chisogne
Robert S a écrit : I am running a Woody server. I'd like to run php scripts from the command line, but I note that the php/php4 executable is not in my PATH. just install php4-cgi package (apt-get install php4-cgi) and the PHP 4 CLI will be install : /usr/bin/php4 Next time, try to use 'apt-cache

Re: [PHP] Command-line php in debian/woody

2005-04-06 Thread Andy Pieters
Hi You might want to download the php source and compile the cli binary yourself (Command Line Interface) It takes only little time compared to compiling it as an apache module Once you got thing setup, you can drop the php extension and just put a shebang like this #! /usr/bin/php At the s

Re: [PHP] Command-line php in debian/woody

2005-04-06 Thread Robert S
> Should you ask this at a debian list? I tried . . .no luck. I thought that you php folks might know a bit more about specific versions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Command-line php in debian/woody

2005-04-06 Thread Burhan Khalid
Robert S wrote: I am running a Woody server. I'd like to run php scripts from the command line, but I note that the php/php4 executable is not in my PATH. Should you ask this at a debian list? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Command line php....

2003-08-14 Thread John Nichel
4.3.2 Ray Hunter wrote: Technically, yes it should however, I think this is a bug...are you running php 5b? -- BigDog - Original Message - From: "John Nichel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 05, 2003 9:07 PM Subject: [PHP] Command line php Can some

Re: [PHP] Command line php....

2003-08-09 Thread Ray Hunter
Technically, yes it should however, I think this is a bug...are you running php 5b? -- BigDog - Original Message - From: "John Nichel" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 05, 2003 9:07 PM Subject: [PHP] Command line php > Can someone tell me why php w

Re: [PHP] Command line php....

2003-08-07 Thread John Nichel
That did it. Thanks. Jason Wong wrote: On Wednesday 06 August 2003 11:11, John Nichel wrote: 4.3.2 Try disabling output buffer in php.ini. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Command line php....

2003-08-05 Thread Jason Wong
On Wednesday 06 August 2003 11:11, John Nichel wrote: > 4.3.2 Try disabling output buffer in php.ini. -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development *

Re: [PHP] Command line php output redirection.

2003-06-25 Thread Joshua Moore-Oliva
That worked, thanks. On June 25, 2003 07:16 pm, David Nicholson wrote: > Hello, > > > This is a reply to an e-mail that you wrote on Wed, 25 Jun 2003 at 23:48, > lines prefixed by '>' were originally written by you. > > > php parser.php > temp > > temp only contains > > Content-type: text/html

Re: [PHP] Command line php output redirection.

2003-06-25 Thread David Nicholson
Hello, This is a reply to an e-mail that you wrote on Wed, 25 Jun 2003 at 23:48, lines prefixed by '>' were originally written by you. > php parser.php > temp > temp only contains > Content-type: text/html > X-Powered-By: PHP/4.3.2 Maybe try using the -q parameter? what do you get then? -q

Re: [PHP] Command line php output redirection.

2003-06-25 Thread Chris Sherwood
try using fopen(); http://www.php.net/manual/en/function.fopen.php - Original Message - From: "Joshua Moore-Oliva" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 25, 2003 3:37 PM Subject: [PHP] Command line php output redirection. > This is really scaring me as file r

RE: [PHP] Command line php

2003-04-01 Thread Jennifer Goodie
, 2003 6:01 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP] Command line php > > > I did that orginally, but it waits for me to enter 255 characters before > closing the freadno matter how many times I hit enter. > > > Benny Pedersen wrote: > > > >

  1   2   >