RE: [PHP-DEV] ini question
| From: | David Viner | Date: | Fri, 20 Sep 2002 00:31:16 +0000 |
| Subject: | RE: [PHP-DEV] ini question | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-88490@lists.php.net to get a copy of this message | ||
I suspect that this is where my error is. But I have added another fprintf
to the mod_php4.c file that prints a message when entering the
php_init_handler function and when it exits. The php_init_handler function
is registered as the module_init callback which I believe is what Apache
calls when initializing the module.
Amazingly, it prints this: (I added the parentheses below to identify the
src file)
mod_php4.c: php_init_handler: starting to run
(zend_ini_scanner.l) lex returning 'startofphpini'
(zend_ini_scanner.l) lex returning 'hereami'
(zend_ini_parser.y) 'startofphpini' = 'hereami'
(zend_ini_scanner.l) lex returning 'engine'
(zend_ini_parser.y) 'engine' = '1'
(zend_ini_scanner.l) lex returning 'short_open_tag'
(zend_ini_parser.y) 'short_open_tag' = '1'
(zend_ini_scanner.l) lex returning 'asp_tags'
(zend_ini_parser.y) 'asp_tags' = ''
.. snipped ..
mod_php4.c: php_init_handler: all completed
mod_php4.c: php_init_handler: all completed
Apache/1.3.23 (Win32) PHP/4.3.0-dev running...
(zend_ini_parser.y) 'startofphpini' = 'hereami'
(zend_ini_parser.y) 'engine' = '1'
(zend_ini_parser.y) 'short_open_tag' = '1'
(zend_ini_parser.y) 'asp_tags' = ''
.. snipped ..
At the initial step, it is clear that the ini parser is called by
php_init_handler. But why is the same "php_ini_handler: starting to run"
not printed the second time? And, why does the parser no longer call the
lexer?
I am sure that you are correct, Rasmus, and apache is calling it twice, but
what I don't understand is, why are the messages not identical?
dave
-----Original Message-----
From: Rasmus Lerdorf [mailto:rasmus@php.net]
Sent: Thursday, September 19, 2002 5:21 PM
To: David Viner
Cc: Php-Dev@lists. php. net
Subject: RE: [PHP-DEV] ini question
Apache calls the module startup hook twice.
On Thu, 19 Sep 2002, David Viner wrote:
> After some further tweaking and fprintf-ing, it appears that the second
> round of parser print-outs somehow do not rely upon the lexer in
> zend_ini_scanner.l. So I am completely unsure of what is going on.
>
> Is there any documentation that I should read to help me understand this?
> (I own and have examined the OReilly Writing Apache Modules book (in case
> this was the child processes each parsing the ini file on their own) but
to
> no avail.) Is there Zend documentation of the startup process?
>
> dave
>
>
> -----Original Message-----
> From: David Viner [mailto:dviner@yahoo-inc.com]
> Sent: Wednesday, September 18, 2002 3:45 PM
> To: Php-Dev@lists. php. net
> Subject: [PHP-DEV] ini question
>
>
> Hi,
> I turned on DEBUG_CFG_PARSER in Zend/zend_ini_parser.y which has the
parser
> spit out each key-value pair it discovers. I noticed when I start my
> Apache, it actually spits everything out twice. The first time I know
comes
> from php_module_startup (called from php_apache_startup which is the init
> handler in sapi/apache/mod_php4.c). What causes the parser to spit out
all
> the key-value pairs the second time?
>
>
> dave
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP Development Mailing List <http://www.php.net/>
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php