Re: [vox-tech] Alternative to PHP Scripting

2011-07-13 Thread Bill Kendrick
On Tue, Jul 12, 2011 at 11:40:08AM -0700, Rick Moen wrote:
> Quoting Gandalf Parker (gand...@community.net):
> 
> > But I am going to save it. If all a person knows is PHP I can see where it 
> > might be the shortest route.
> 
> The PHP interpreter can also be used locally (e.g., via phpsh) without
> involving a Web server at all.

Or just 'php' (not 'phpsh', which is an interactive shell for PHP).

e.g.:

  $ php somescript.php


or even just put a shebang in at the top of the PHP file, and set it exec,
e.g.:

  $ cat > junk.php
  #!/usr/bin/php
  
  [Ctrl+D]
  $ chmod 700 junk.php
  $ ./junk.php
  Hello world
  $


-bill!
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Alternative to PHP Scripting

2011-07-12 Thread Rick Moen
Quoting Gandalf Parker (gand...@community.net):

> But I am going to save it. If all a person knows is PHP I can see where it 
> might be the shortest route.

The PHP interpreter can also be used locally (e.g., via phpsh) without
involving a Web server at all.

(It was more than a little unclear whether the original poster lacked
command shell access.)

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Alternative to PHP Scripting

2011-07-12 Thread Chris Jenks

   Well, this particular application was for uploading data to a database, 
and it solved the problem of simultaneous submissions slowing the database 
server, especially if frustrated users then try to repeatedly resubmit.

On Tue, 12 Jul 2011, Gandalf  Parker wrote:

> On Tue, 12 Jul 2011, Chris Jenks wrote:
>>   I've solved a similar problem by running the php program as a daemon
>> launched by cron and using a web page to give it work by creating a file
>> in the /tmp directory. Of course the web page still has to run php to
>> create the file.
>
> WOW. That seems like a creative (and extensive) workaround to get a web
> language to run as a cron job.
>
> But I am going to save it. If all a person knows is PHP I can see where it
> might be the shortest route.
>
> Gandalf Parker
>
> ___
> vox-tech mailing list
> vox-tech@lists.lugod.org
> http://lists.lugod.org/mailman/listinfo/vox-tech
>
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Alternative to PHP Scripting

2011-07-12 Thread Gandalf Parker
On Tue, 12 Jul 2011, Chris Jenks wrote:
>   I've solved a similar problem by running the php program as a daemon
> launched by cron and using a web page to give it work by creating a file
> in the /tmp directory. Of course the web page still has to run php to
> create the file.

WOW. That seems like a creative (and extensive) workaround to get a web 
language to run as a cron job.

But I am going to save it. If all a person knows is PHP I can see where it 
might be the shortest route.

Gandalf Parker

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Alternative to PHP Scripting

2011-07-12 Thread Chris Jenks

On Tue, 12 Jul 2011, Gandalf  Parker wrote:

> On Mon, 11 Jul 2011, Richard S. Crawford wrote:
>
>> I've been trying to use PHP to create a backup script that would read
>> filenames from a directory, then copy those filenames into a .zip file, then
>> delete the original files. I wrote a PHP script to do this, but it seemed to
>> spawn so many httpd child processes that the server load skyrocketed and
>> users weren't able to get to our website.
>>
>> So my question is, what other options do I have for performing this sort of
>> task?
>
> Im not seeing what the web interfacing is. Did you want to kick off this
> script from the web? You dont have access to a cron file to have it run
> at set times?
>
> But I think any language will handle what you want. Personally Id just
> write it in shell script. It doesnt sound like it needs anything beyond
> that. Or if it did then Id write it in Basic. Whatever you know.
>
> Gandalf  Parker

   I've solved a similar problem by running the php program as a daemon 
launched by cron and using a web page to give it work by creating a file 
in the /tmp directory. Of course the web page still has to run php to 
create the file.

Chris
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Alternative to PHP Scripting

2011-07-12 Thread Gandalf Parker
On Mon, 11 Jul 2011, Richard S. Crawford wrote:

> I've been trying to use PHP to create a backup script that would read
> filenames from a directory, then copy those filenames into a .zip file, then
> delete the original files. I wrote a PHP script to do this, but it seemed to
> spawn so many httpd child processes that the server load skyrocketed and
> users weren't able to get to our website.
>
> So my question is, what other options do I have for performing this sort of
> task?

Im not seeing what the web interfacing is. Did you want to kick off this 
script from the web? You dont have access to a cron file to have it run 
at set times?

But I think any language will handle what you want. Personally Id just 
write it in shell script. It doesnt sound like it needs anything beyond 
that. Or if it did then Id write it in Basic. Whatever you know.


Gandalf  Parker
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Alternative to PHP Scripting

2011-07-11 Thread Alex Mandel
On 07/11/2011 03:57 PM, Michael Robert Seydel wrote:
> On Mon, Jul 11, 2011 at 2:08 PM, Richard S. Crawford
>  wrote:
>> I've been trying to use PHP to create a backup script that would read
>> filenames from a directory, then copy those filenames into a .zip file, then
>> delete the original files. I wrote a PHP script to do this, but it seemed to
>> spawn so many httpd child processes that the server load skyrocketed and
>> users weren't able to get to our website.
>>
>> So my question is, what other options do I have for performing this sort of
>> task?
>>
>> --
>> Sláinte,
>> Richard S. Crawford (rich...@underpope.com)
>> http://www.underpope.com
> 
> Being a Python fan, I'd recommend Python. I would in particular use
> mod_python for this ( http://en.wikipedia.org/wiki/Mod_python )
> although mod_wsgi is the newer toy that might suit your needs better.
> I know that mod_python for sure doesn't spawn child processes though,
> which solve your particular problem.

mod_python is not recommended for new development and is no longer
maintained. mod_wsgi is the favored replacement as noted by install
instructions for django, trac, pylons etc...

Others around here might also say, pick whatever lang you like - Ruby,
Haskell, C, Perl or anything else that can be run via cgi scripts (or
the new way fastcgi).

I could see a quick solution to your particular issue as a bash 10 line
or less bash script run via cgi.

Enjoy,
Alex

___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech


Re: [vox-tech] Alternative to PHP Scripting

2011-07-11 Thread Michael Robert Seydel
On Mon, Jul 11, 2011 at 2:08 PM, Richard S. Crawford
 wrote:
> I've been trying to use PHP to create a backup script that would read
> filenames from a directory, then copy those filenames into a .zip file, then
> delete the original files. I wrote a PHP script to do this, but it seemed to
> spawn so many httpd child processes that the server load skyrocketed and
> users weren't able to get to our website.
>
> So my question is, what other options do I have for performing this sort of
> task?
>
> --
> Sláinte,
> Richard S. Crawford (rich...@underpope.com)
> http://www.underpope.com

Being a Python fan, I'd recommend Python. I would in particular use
mod_python for this ( http://en.wikipedia.org/wiki/Mod_python )
although mod_wsgi is the newer toy that might suit your needs better.
I know that mod_python for sure doesn't spawn child processes though,
which solve your particular problem.
___
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech