Re: include_path affects script being run

From: Date: Sun, 27 Aug 2000 17:46:40 +0000
Subject: Re: include_path affects script being run
Groups: php.dev 
Request: Send a blank email to php-dev+get-30819@lists.php.net to get a copy of this message
This looks like a 4.0.2 showstopper to me as it is not the first report. Are you using the PHP Apache module or PHP CGI? Please put phpinfo() in the test.php in /path/to/includes and mail us the output (PATH_TRANSLATED, DOCUMENT_ROOT and so on). I can think of how Sascha's patch might have broken CGI mode when using doc_root but I would like to first hear from you if this is CGI or Apache module. Please respond ASAP. Thanks, Andi At 03:07 27/08/00 +0000, php4@developersdesk.com wrote:
With RC1 the include_path can override the program being executed. As late as 200007300345 it did not. Also, when PHP encounters a directory in the path with the same name as the currently executing program it fails with: Fatal error: input in flex scanner failed in /web/hosts/www.southernidahojobs.com/phplib/pre/test.php on line 1 It took a while to figure out that PHP is taking the name of the program being executed (the URL from the browser) and searching the path for it. I believe that it should always execute the program in DocumentRoot like it has before. Although I found the problem with a conflicting directory, I have found it is also triggered by conflicting file names. To see it you need a file or directory in the include path, before ./ with the same name as the script you are executing. For example: in some config file php_value include_path /path/to/includes:./:/more/paths in DocumentRoot test.php: ------------------------- <? phpinfo(); ?> ------------------------- in /path/to/includes/ test.php: ------------------------- hello from the path! ------------------------- Now hit http://www.somedomain.com/test.php and you get: hello from the path! At least I do. If you move test.php from /path/to/includes to /more/paths it will not fail. (After the ./ in the include_path) This is on the new (6.3) SuSe machine using apache 1.3.12, mod-ssl 2.6.5, openssl 0.9.5a and RC1 or the 07/30 shapshot all freshly compiled from tarballs. Also, if you go to the /path/to/includes directory and: rm test.php mkdir test.php Now you should get: Fatal error: input in flex scanner failed in /web/hosts/www.southernidahojobs.com/phplib/pre/test.php on line 1 This is probably not too unreasonable, but I had to take a break after a couple hours trying to track it down before I could figure out that it was a matter of pointing php at a directory rather than a file. I hope I am not the only one who can see this one... Rick Widmer Internet Marketing Specialists http://www.developersdesk.com -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#30819) next »