note 98033 added to ini.core

From: Date: Fri, 21 May 2010 15:50:27 +0000
Subject: note 98033 added to ini.core
Groups: php.notes 
Request: Send a blank email to php-notes+get-169501@lists.php.net to get a copy of this message
Has the behavior of include/require WRT "." in "include_path" changed in a recent PHP version? Scenario: /home/XXXXX/catalog/index.php requires 'includes/application_top.php'. found OK /home/XXXXX/catalog/includes/application_top.php includes 'includes/languages/english.php' (for example). /home/XXXXX/catalog/includes/languages/english.php exists. This used to work fine, but lately lots of users of certain products get "not found" errors. They are using the default "include_path" which includes ".". I haven't been able to prove it, but it looks like in older PHPs, "." is the directory of the OUTERMOST includer (/catalog/), while in newer PHPs, it is the directory of the INNERMOST includer (/catalog/includes/). I suspect that this is resulting in PHP looking for /home/XXXXX/catalog/includes/includes/languages/english.php, and not finding it. Unfortunately, the error message doesn't give the resulting full path, so I can't confirm it. One could add /home/XXXXX/catalog/ to the include_path, but in this particular case, there is a problem: some scripts are running in /catalog/admin/, so they will pick up the wrong (/catalog/) application_top.php file (/home/XXXXX/catalog/includes/application_top.php, rather than /home/XXXXX/catalog/admin/includes/application_top.php), using this "fix". Any suggestions? Is the only other way out to rewrite all the requires and includes with absolute (full) paths? ---- Server IP: 69.147.83.197 Probable Submitter: 98.15.164.246 ---- Manual Page -- http://www.php.net/manual/en/ini.core.php Edit -- https://master.php.net/note/edit/98033 Del: integrated -- https://master.php.net/note/delete/98033/integrated Del: useless -- https://master.php.net/note/delete/98033/useless Del: bad code -- https://master.php.net/note/delete/98033/bad+code Del: spam -- https://master.php.net/note/delete/98033/spam Del: non-english -- https://master.php.net/note/delete/98033/non-english Del: in docs -- https://master.php.net/note/delete/98033/in+docs Del: other reasons-- https://master.php.net/note/delete/98033 Reject -- https://master.php.net/note/reject/98033 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#169501) next »