php-general Digest 2 Jun 2012 15:04:22 -0000 Issue 7837

Topics (messages 318097 through 318101):

xcache on php on CentOS 5.8
        318097 by: Kaushal Shriyan

Re: Simple Email System (SES) Provider
        318098 by: Ashley Sheridan

Re: Happy Diamond Jubilee everyone!
        318099 by: Ashley Sheridan
        318100 by: Bastien

Re: progress indicators in browsers for long running php scripts?
        318101 by: Matijn Woudt

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 ---
Hi,

Any compatible version of xcache with php version 5.3.13 on CentOS 5.8?

Regards

Kaushal

--- End Message ---
--- Begin Message ---

Bastien Koert <phps...@gmail.com> wrote:

>On Fri, Jun 1, 2012 at 8:32 PM, Don Wieland <d...@pointmade.net> wrote:
>> Hi all,
>>
>> I built a system in PHP/mySQL where a group of users post events,
>sign-up
>> for events, change their arrival times, remove thier names from
>events, and
>> post related notes on the events. Each time an action is done, an
>email is
>> generated to the entire group that their has been a change. Pretty
>standard
>> stuff...
>>
>> Today I just got an Mail Delivery System email with this error:
>>
>> Domain dwdcweb.info has exceeded the max emails per hour (350/350
>(100%))
>> allowed.  Message will be reattempted later
>>
>> I contacted my VPS provider and they just alerted me that there is a
>limit
>> on how many emails my server can send per hour.
>>
>> They recommended I find a 3rd party service provider with support PHP
>API
>> connections.
>>
>> My budget is limited. Does anyone have any suggestions of companies
>that
>> might work for my scenario?
>>
>> Any feedback is appreciated ;-)
>>
>> Don
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>Amazon has an email service you can plug in to with php
>
>http://aws.amazon.com/ses/
>
>
>--
>
>Bastien
>
>Cat, the other other white meat
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

Rather than send an email to the group right away, could you not store up 
messages and send them out with more than one change in? So if person A creates 
an event, and person B and C sign to attend, your system would hold on and post 
all 3 messages in the same email.

Facebook has a similar system to reduce the number of emails it sends. I tell 
you, its appreciated by the recipients too more often than not!

Thanks,
Ash
http://ashleysheridan.co.uk

--- End Message ---
--- Begin Message ---

Paul M Foster <pa...@quillandmouse.com> wrote:

>On Fri, Jun 01, 2012 at 06:44:17PM +0100, Ashley Sheridan wrote:
>
>> This is a bit of a shameless plug, but it is a Friday and a pretty
>> special weekend over here.
>>
>> I recently got to work on something a bit fun at work in my spare
>time
>> and they liked it so much that it got used internally to celebrate
>the
>> jubilee weekend.
>>
>> This is the result http://jubilee.themlondon.com
>>
>> For those of you interested, the leg-work is done by a bunch of PHP
>> scripts run in the background via cron, split into 3 tasks:
>>
>>
>>      1. A script goes out and searches Twitter for tweets that
>mention
>>         the jubilee, one instance per keyword and records those to a
>DB
>>         to limit the draw on the Twitter API
>>      2. A second script goes over those tweets and pulls in all the
>>         non-default profile images for each unique user
>>      3. Lastly, the image is built as 12 separate tiles every half
>hour,
>>         using PHP and GD to match the average colour of each profile
>pic
>>         to a spot on the image, and then these are stitched together
>for
>>         the final image
>>
>> Anyway, hope you guys all have a great weekend, more so if you're
>> unlucky enough to be working over the whole 4 days :-/
>
>*Very* nice work!
>
>Paul
>
>--
>Paul M. Foster
>http://noferblatz.com
>http://quillandmouse.com
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

Thanks, it did take a little while to get right. I might be able to post some 
bits of code if anyone is interested?

Thanks,
Ash
http://ashleysheridan.co.uk

--- End Message ---
--- Begin Message ---

Bastien Koert

On 2012-06-02, at 4:51 AM, Ashley Sheridan <a...@ashleysheridan.co.uk> wrote:

> 
> 
> Paul M Foster <pa...@quillandmouse.com> wrote:
> 
>> On Fri, Jun 01, 2012 at 06:44:17PM +0100, Ashley Sheridan wrote:
>> 
>>> This is a bit of a shameless plug, but it is a Friday and a pretty
>>> special weekend over here.
>>> 
>>> I recently got to work on something a bit fun at work in my spare
>> time
>>> and they liked it so much that it got used internally to celebrate
>> the
>>> jubilee weekend.
>>> 
>>> This is the result http://jubilee.themlondon.com 
>>> 
>>> For those of you interested, the leg-work is done by a bunch of PHP
>>> scripts run in the background via cron, split into 3 tasks:
>>> 
>>> 
>>>     1. A script goes out and searches Twitter for tweets that
>> mention
>>>        the jubilee, one instance per keyword and records those to a
>> DB
>>>        to limit the draw on the Twitter API
>>>     2. A second script goes over those tweets and pulls in all the
>>>        non-default profile images for each unique user
>>>     3. Lastly, the image is built as 12 separate tiles every half
>> hour,
>>>        using PHP and GD to match the average colour of each profile
>> pic
>>>        to a spot on the image, and then these are stitched together
>> for
>>>        the final image
>>> 
>>> Anyway, hope you guys all have a great weekend, more so if you're
>>> unlucky enough to be working over the whole 4 days :-/
>> 
>> *Very* nice work!
>> 
>> Paul
>> 
>> -- 
>> Paul M. Foster
>> http://noferblatz.com
>> http://quillandmouse.com
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> Thanks, it did take a little while to get right. I might be able to post some 
> bits of code if anyone is interested?
> 
> Thanks,
> Ash
> http://ashleysheridan.co.uk
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

I'm sure lots of us are interested. It's very cool. Nice job!

Bastien

--- End Message ---
--- Begin Message ---
On Fri, Jun 1, 2012 at 3:45 PM, rene7705 <rene7...@gmail.com> wrote:
> Hi..
>
> I've got several scripts now that may run for a long time; the
> self-test script for my htmlMicroscope, my serviceLog component when
> it calculates totals for a large number of hits, a curl script that is
> likely to one day crawl a hundred or so RSS urls in a single update,
> etc, etc.

I don't see how these scripts would need more than the default 30
seconds execution time, except for the crawler maybe. But you want the
crawler to be a cronjob anyway.

>
> I'd like to build a generic system (and opensource it) to allow PHP to
> execute a long running script, and somehow get a progress bar with
> "what am I doing now"-status-msg for such processes, in the browser.
>
> The easiest thing, and maybe the only way this will work, is to load
> up a site's framework html (so as to display the site), then call the
> long-running script via ajax.
> However, a long-running script needs set_time_limit(0), which is
> something shared hosters just won't do for browsers.
> A moderately good shared hoster will however allow you to
> set_time_limit(0) for PHP cron jobs.

I guess you're on a old fashioned safe mode host? Never had any
problems using set_time_limit on web scripts on my previous shared
hosters (got private servers now).

>
> So I'd need to build a cron PHP daemon that listens for new tasks.
> That won't be much of a problem, I've done it before.
>
> But the task definition itself puzzles me a lot still.
> I suppose I'd need an ID for the task/job, and include in the task def
> what worker-php-script and worker-php-function to call, with also the
> parameters for the worker function.
> The worker function would then call back certain daemon functions to
> push status updates to the browser.

I wonder how you're planning on doing that. Since shared hosts have
either safe mode on, or at least disabled the system call, you cannot
call the php binary. I guess there are two options:
1) Include all possible worker scripts that you're are going to use,
and call the worker function.
2) Load the file and call eval on it.

Note that in both cases, the script still runs inside the cronjob
daemon, and the daemon will not be able to handle other task. You
would need to fork, but I doubt the PCNTL functions are available on
your shared host..

For the task definition, I think I would choose a set of defines to
give each task a unique ID. Set up a task table with ID,
class/function. Then define this function with a abstract header with
just one parameter, $data, and have each task interpret this data as
it wishes.

>
> And the browser can then just kick off the task, and poll every 5
> seconds or so for very brief status updates in JSON format.

Database, sockets?

>
> This is how I can import videos of any length into my CMS, and convert
> them to flash video aswell (even optionally converting on another,
> dedicated server).

You're probably limited to the upload size limits. These are usually
very tight at shared hosting...

>
> Once again I'm asking you all for input and tips before I begin on
> this new workDaemon component of mine..
>
> I suppose most of you'd want a neat PHP object of it? Not my usual
> procedural-only PHP coding?

I wouldn't mind a simple while(true) procedural daemon, though the
tasks are probably best defined as classes.

- Matijn

--- End Message ---

Reply via email to