Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:25906 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22801 invoked by uid 1010); 2 Oct 2006 13:59:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 22786 invoked from network); 2 Oct 2006 13:59:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Oct 2006 13:59:10 -0000 X-Host-Fingerprint: 212.77.172.62 unknown Received: from [212.77.172.62] ([212.77.172.62:10940] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5F/8A-59377-C2B11254 for ; Mon, 02 Oct 2006 09:59:09 -0400 To: internals@lists.php.net Message-ID: <45211B28.8090007@onevision.com> Date: Mon, 02 Oct 2006 15:59:04 +0200 User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 CC: polita@php.net References: <57.D8.08641.D099A154@pb1.pair.com> <7F.60.15221.0BC6D154@pb1.pair.com> In-Reply-To: <7F.60.15221.0BC6D154@pb1.pair.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Posted-By: 212.77.172.62 Subject: Re: [PHP Guru question]: run php script from within pecl extension From: Roland.Schwingel@onevision.com (Roland Schwingel) Hi Sara... Thanks for your reply... Sara Golemon schrieb: >> 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? I love cron, but I am mainly (85%) on windows with my apps and want to have a simple and easy setup and not a bunch of applications/services to install. There is just the apache service bringing in php and my pecl. All other solutions I know are much more voluminous and have more errorpoints. >> 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). Do you have some example / skeleton stuff for this or can you give me a pointer on this where to find? Many thanks in advance, Roland