Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25898 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88855 invoked by uid 1010); 29 Sep 2006 18:57:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 88839 invoked from network); 29 Sep 2006 18:57:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Sep 2006 18:57:52 -0000 X-Host-Fingerprint: 207.126.230.225 nat-dip4.corp.yahoo.com Received: from [207.126.230.225] ([207.126.230.225:23336] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/60-15221-0BC6D154 for ; Fri, 29 Sep 2006 14:57:52 -0400 Message-ID: <7F.60.15221.0BC6D154@pb1.pair.com> To: internals@lists.php.net References: <57.D8.08641.D099A154@pb1.pair.com> Date: Fri, 29 Sep 2006 11:47:20 -0700 Lines: 28 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962 X-RFC2646: Format=Flowed; Response X-Posted-By: 207.126.230.225 Subject: Re: [PHP Guru question]: run php script from within pecl extension From: pollita@php.net ("Sara Golemon") > For several reasons I need to call a php script every x minutes. > I need that on several platforms so I started to write a pecl > extension that implements something like a cron service. > Why not cron then? > Obviously I miss something in initing php, because php > crashes in main/streams/streams.c function php_stream_locate_url_wrapper() > when I call php_execute_script() > Correct. You're not in a request (you're probably not even in an identifiable/unique thread context). Both are fixable by spinning up a context at thread startup and either (A) wrapping a request activate/deactivate around that timer, or (B) wrapping the activate/deactivate just inside your thread context (giving you a single-uberlong-running request). > because the variable > 'wrapper_hash' inited at the very beginning in that > function appears to become a bad value. > Which tells me that both of the issues above are relevant. But coming back to the first question: What's wrong with cron? -Sara