|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[1999-12-31 20:36 UTC] djm at web dot us dot uu dot net
I'm having a lex-related problem. I compiled PHP4.0b3 as a DSO in apache 1.3.9.
ASP-style tags and the code in them are displayed in the browser instead of being parsed, even though the httpd.conf contains
php_flag asp_tags On
phpinfo() confirms that the Local Value of asp_tags flag is On.
All of the other tags styles are parsed correctly, but stuff like
<% echo ("You may optionally use ASP-style tags"); $variable = "boo"; %>
<%= $variable; # This is a shortcut for "<%echo .." %>
gets sent verbatim to the browser.
I've looked through zend-scanner.l and can't find anything wrong. I tried removing the conditionals on asp_tags there, and changing the <% and %> to <@ and @>
in that file and in my PHP script to see if % was causing trouble, but neither of those approaches worked. I also tried removing optimization when compiling
zend-scanner.c. No effect.
This is weird.
I was able to confirm that I was getting my changed scanner by breaking the rules for identifying the short SGML tags. I found that there's a missing dependency because I had to
rm libzend/libzend.la
in order to force the php module to be rebuilt after the scanner changed.
I'm using PHP compiled as a DSO with apache 1.3.9.
Compiled using flex version 2.5.4 and gcc 2.7.2.1.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 02:00:01 2025 UTC |
This is partly fixed in 4.0.3pl1. ASP tags are recognized, but they still don't work with single-line comments. You still need to apply the patch I submitted for the "eat one line comments" line of the lexer. All it does is replace "?" with "[?%]" in the regexp so that it works for <% as well as <?. Of course, if you have asp_tags off, you might not want that to happen... I'm not sure what's best in that case. Here is a valid PHP script that gets a parse error from 4.0.3pl1. <html><head><title>comments test</title></head> <body> <hr> <?php echo("Hash comments work\n"); $variable="blah"; # never mind this stuff ?> <?= $variable; # This is a shortcut for "<?echo .." ?> <p> <% echo ("You may optionally use ASP-style tags"); $variable = "boo"; %> <% echo (" (if they work)"); # this should be ignored also %> <%= $variable; # This is a shortcut for "<%echo .." %> <hr> <? phpinfo() ?> </body> </html>