You are here: Re: cron or command line: run a very long php script « PHP Programming Language « IT news, forums, messages
Re: cron or command line: run a very long php script

Posted by C. on 08/19/07 12:38

On 17 Aug, 19:13, "burgermeiste...@gmail.com"
<burgermeiste...@gmail.com> wrote:
>
> > This list is about 3000 links. Each album may have 500 or more pictures in it.
> > the script looks in the specified dir, and creates thumbnails if they are not
> > present.
>
> As you suggested in your subject line, probably the best route to go
> would be to set up a command line script to process the file,

No - that's the worst route to go.

> process files at the time of introduction in the system
is the best solution.

Admittedly, that is not going to solve the problem for existing
images. But tying a check/generation into the viewing page provides a
simple interface to updating the images which should only need done
once.

> Just remember, in command-line scripts for PHP, you have to first give
> a path to the interpreter like so:
> #!/usr/bin/php
>

....if you are running on a POSIX type system, but you'll also need to
make the script executable. RTFM - http://www.php.net/manual/en/features.commandline.php

Yes you do it via a cron job if you prefer - there's lot of
discussions about how to do this - and even toolkits which emulate it
when you don't have access to cron. But for your purposes this is just
adding unnecessary complexity.

C.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация