Date: 01/08/01
- Next message: Flying: "Re[2]: [PHP-DEV] PHP, Xerces, Xalan"
- Previous message: alex <email protected>: "[PHP-DEV] PHP 4.0 Bug #8591: Build fails at main/main.c because XtOffset got defined to something bogus."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
What do you mean have I tested it, have you ? You can see the problem
by using phpinfo(). If you want a really simple test (looks like you need
one) :-
Document root is /var/www/html/
/var/www/html/.htaccess (make sure your Apache config file has an
AllowOveride to allow this ) ->
AddHandler parser .file
Action parser /parser.php
/var/www/html/parser.php ->
<?
phpinfo();
print "PATH_TRANSLATED=${PATH_TRANSLATED}";
?>
/var/www/html/test.file ->
Contents are un-important
Use your browser to go to http://your.server/test.file.
Without the patch the first occurence of PATH_TRANSLATED is the one that
is part of the Apache enviroment (this one is correct in most Apache
circumstances) - /var/www/html/test.file
The second occurence is the php version of this variable (the one the code
in php re-writes regardless) - /var/www/html/parser.php
And the third occurence is the print statement in the script -
/var/www/html/parser.php.
After the patch all the three values will be /var/www/html/test.file (the
Apache generated version).
There is a bug in Apache where Apache calls parser.php even if test.file
does not exist (I had told the Apache developers about this, never heard
an answer, see http://bugs.apache.org/index.cgi/full/5700).
I had gone over this in my original report ...
And before you ask the problem still exists in the latest php4 snapshot
(php4-200101080145).
Rgds Drew Wells
Jani Taskinen said:
> On Thu, 4 Jan 2001 drew <email protected> wrote:
>
> >Ok, this bug is not fixed, I had at look at the source for this section in
> >php-4.0.4 and it still just overwrites the PATH_TRANSLATED variable with
> >the script_filename. The patch I gave only set the PATH_TRANSLATED
> >variable to the script_filename if there is not an existing
> >PATH_TRANSLATED (as supplied by Apache).
>
> Did you try compiling and really running it??
>
> --Jani
>
>
>
>
>
> >Rgds Drew Wells
> >
> > Bug Database said:
> >
> >> ID: 6795
> >> Updated by: sniper
> >> Reported By: drew <email protected>
> >> Old-Status: Feedback
> >> Status: Closed
> >> Bug Type: Apache related
> >> Assigned To:
> >> Comments:
> >>
> >> No feedback, considered fixed.
> >>
> >> --Jani
> >>
> >> Previous Comments:
> >> ---------------------------------------------------------------------------
> >>
> >> [2000-12-04 09:01:27] sniper <email protected>
> >> Could you please check if this problem exists when
> >> using the PHP 4.0.4RC3:
> >>
> >> http://www.php.net/distributions/php-4.0.4RC3.tar.gz
> >>
> >> --Jani
> >>
> >> ---------------------------------------------------------------------------
> >>
> >> [2000-09-17 19:49:16] drew <email protected>
> >> There seems to be a problem with the values of $PATH_TRANSLATED under different circumstances :-
> >>
> >> In your Apache document_root create the following files :-
> >>
> >> .htaccess
> >> AddHandler testhandler .test
> >> Action testhandler handler.phtml
> >>
> >> handler.phtml
> >> <? print "PATH_TRANSLATED = $PATH_TRANSLATED"; ?>
> >>
> >> index.test
> >> Content not used
> >>
> >> You will need AllowOverride All (or similar) in the Directory spec for your Apache document root (to all adding handlers).
> >>
> >> Here is a list of requests and responses
> >>
> >> http://localhost/index.test -
> >> PATH_TRANSLATED = /home/httpd/html/handler.phtml (Incorrect)
> >> http://localhost/handler.phtml -
> >> PATH_TRANSLATED = /home/httpd/html/handler.phtml (Correct)
> >> http://localhost/index.test/path_info -
> >> PATH_TRANSLATED = /home/httpd/html/handler.phtml (Incorrect)
> >> http://localhost/handler.phtml/path_info -
> >> PATH_TRANSLATED = /home/httpd/html/handler.phtml (Incorrect)
> >>
> >> The reason I have put incorrect for 3 of the tests is that the value differs from the value of PATH_TRANSLATED that Apache provides. PHP just copies the value of SCRIPT_FILENAME over the top of PATH_TRANSLATED. Please find attached a patch to make to responses the same as Apache's version of PATH_TRANSLATED.
> >>
> >> http://localhost/index.test -
> >> PATH_TRANSLATED = /home/httpd/html/index.test (Correct)
> >> http://localhost/handler.phtml -
> >> PATH_TRANSLATED = /home/httpd/html/handler.phtml (Correct)
> >> http://localhost/index.test/path_info -
> >> PATH_TRANSLATED = /home/httpd/html/index.test/path_info (Correct)
> >> http://localhost/handler.phtml/path_info -
> >> PATH_TRANSLATED = /home/httpd/html/path_info (Incorrect)
> >>
> >> Not really sure whats going on with the last test - bug in Apache. There is also a pretty big bug in Apache when doing these type of tests from a public_html (~user) type of directory.
> >>
> >> Rgds Drew Wells
> >>
> >> --- php-4.0.2/sapi/apache/mod_php4.c.orig Sun Aug 20 15:29:00 2000
> >> +++ php-4.0.2/sapi/apache/mod_php4.c Mon Sep 18 12:16:49 2000
> >> @@ -232,7 +232,7 @@
> >> register int i;
> >> array_header *arr = table_elts(((request_rec *) SG(server_context))->subprocess_env);
> >> table_entry *elts = (table_entry *) arr->elts;
> >> - char *script_filename=NULL;
> >> + char *script_filename = NULL, *path_translated = NULL;
> >>
> >> for (i = 0; i < arr->nelts; i++) {
> >> char *val;
> >> @@ -241,7 +241,10 @@
> >> val = elts[i].val;
> >> if (!strcmp(elts[i].key, "SCRIPT_FILENAME")) {
> >> script_filename = val;
> >> + } else if (!strcmp(elts[i].key, "PATH_TRANSLATED")) {
> >> + path_translated = val;
> >> }
> >> +
> >> } else {
> >> val = empty_string;
> >> }
> >> @@ -249,7 +252,7 @@
> >> }
> >>
> >> /* insert special variables */
> >> - if (script_filename) {
> >> + if (script_filename && !path_translated) {
> >> php_register_variable("PATH_TRANSLATED", script_filename, track_vars_array ELS_CC PLS_CC);
> >> }
> >> php_register_variable("PHP_SELF", ((request_rec *) SG(server_context))->uri, track_vars_array ELS_CC PLS_CC);
> >>
> >>
> >> ---------------------------------------------------------------------------
> >>
> >>
> >> Full Bug description available at: http://bugs.php.net/?id=6795
> >>
> >>
> >
> >
> >
>
>
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Flying: "Re[2]: [PHP-DEV] PHP, Xerces, Xalan"
- Previous message: alex <email protected>: "[PHP-DEV] PHP 4.0 Bug #8591: Build fails at main/main.c because XtOffset got defined to something bogus."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

