[PHP Guru question]: run php script from within pecl extension
| From: | Roland Schwingel | Date: | Wed, 27 Sep 2006 15:30:13 +0000 |
| Subject: | [PHP Guru question]: run php script from within pecl extension | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-25849@lists.php.net to get a copy of this message | ||
Hi...
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.
I am running my php 5.1.5 always together with apache 2.2.3.
So I made a small pecl that spawns a thread using apache apr functions.
In this thread I want to call a php script, so I do this whenever
the time to execute the script is reached:
TSRMLS_FETCH();
zend_file_handle zfd;
zfd.type = ZEND_HANDLE_FILENAME;
zfd.filename = <absolute path to php script to execute>
zfd.free_filename = 0;
zfd.opened_path = NULL;
php_execute_script(&zfd TSRMLS_CC);
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()
because the variable
'wrapper_hash' inited at the very beginning in that
function appears to become a bad value.
So I hope someone here can help me or give me some pointers
to get help...
Thanks in advance,
Roland