php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19808 auto_prepend_file none and apache2
Submitted: 2002-10-07 20:21 UTC Modified: 2002-10-08 14:16 UTC
From: scribles at synthesis dot net Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.2.3 OS: linux
Private report: No CVE-ID: None
 [2002-10-07 20:21 UTC] scribles at synthesis dot net
PHP 4.2.3 and Apache 2.0.43 on Linux

When using
php_value auto_prepend_file ?none?
in Apache configuration files or .htaccess files the script tries to prepend a file called ?none? instead of not prepending a file like it should resulting in the following error. Same thing with auto_append_file.

Warning: Failed opening 'none' for inclusion (include_path='.:/home/synthesis/www/include') in Unknown on line 0

I?ve tried it without quotes and upper case without any effect. Other PHP directives seem to work fine in configuration files and .htaccess files.

I?m guessing Apache changed the meaning of ?none?, but that?s just a guess and I have no idea if it?s intentional or accidental.

I wasn?t sure if this belonged here or as an Apache bug. Sorry if I?m in the wrong place.

-scribles

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-08 08:11 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

If you do not was to have a file automatically appended or prepended, simply do not specify a auto_prepend_file or auto_append_file entry.
 [2002-10-08 12:06 UTC] scribles at synthesis dot net
Thank you for dismissing my claim so quickly however you are wrong. 
The manual, which I did double check, supports what I?m saying? specifically http://www.php.net/manual/en/configuration.directives.php
BEGIN QUOTE
auto_prepend_file string
Specifies the name of a file that is automatically parsed before the main file. The file is included as if it was called with the include() function, so include_path is used.
The special value none disables auto-prepending. 
END QUOTE
Please note the last line, which notes the behavior that is broken in the version I am using. The reason for this behavior is the way Apache applies configuration directives to the directory structure. In the structure /foo/bar anything you apply to the directory foo is also applied to bar and any other subdirectories. If you configure foo to auto_prepend a file you must specifically configure bar to not auto_prepend if you do not want that same behavior in that directory. Hence the need for ?auto_prepend none?. Not only is this behavior documented by the PHP manual and necessary to configure Apache it is also how every version of PHP I?ve used over the past several years has behaved. I?m not sure if the problem is with PHP or Apache however I can assure you the behavior I?m experiencing is a bug.
 [2002-10-08 13:27 UTC] iliaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Sorry about that, you are quite right, none option is supported. However, you should not quote the word 'none'. You'll find that the none option will work properly if it is not quoted. ex. php_value auto_prepend_file none

I've just verified this behaviour using PHP 4.3.0-dev and Apache 2.
 [2002-10-08 14:07 UTC] scribles at synthesis dot net
If you read my original post you?ll notice I pointed out that I tried it without quotes and it still didn?t work. Also I?m using PHP 4.2.2 with Apache 1.3.26 and it works with or without the quotes. I am positive that the problem is the behavior of the software and not how I have it configured.

Is this something that is being changed in 4.3.0 then? Sorry to be so persistent, but I would appreciate knowing if this is something that is going to fix itself in a future release or if I need to find a workaround for my problem. Thank you for the clarification.
 [2002-10-08 14:16 UTC] iliaa@php.net
I've tried this in PHP 4.3.0-dev and it worked. There were some issues setting PHP directives inside .htaccess or httpd.conf which were resolved in 4.3.0, this may very well be the cause of the problem.
The bottom line, is that while using latest CVS aka 4.3.0-dev I cannot replicate the bug you are describing, UNLESS I quote the "none" parameter. Which is wrong since, as comments inside php.ini suggest:
;  foo = none    ; sets foo to an empty string
;  foo = "none"  ; sets foo to the string 'none'

Clearly, your goal is to set auto_prepend_file options to an empty string, which is why you should use none without any quotes.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC