|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-02-04 11:19 UTC] omich at artofaktur dot de
Description:
------------
A script 'A', which 'include's a php script file 'X'
from a subfolder of the php.ini-include path, does work
fine, but the exact same copy of the script of 'A' (call
it 'B') in a different folder does not include the file
'X' at all.
Example here: www.dannemann.com/info.php shows the
environment. The script 'A' is
www.dannemann.com/de/kompetenz/lexikon/search.php
the script 'B' is
www.dannemann.com/at/kompetenz/lexikon/search.php
Both load file 'X' which is located in
www.dannemann.com/global/dict.php
from the global folder, but only in 'de' the include
works, not in 'at'.
In the given code I have replaced the flawed include
command with a hack:
eval (substr (implode ('', file ($DOCUMENT_ROOT.'/
global/dict.php')), 2, -2));
and this works!
We use output buffering before this code and fetched the
output and transparent php sessions without cookies (see
phpinfo-output). Although we use APC-Cache we disabled
it for testing - to no avail even without APC the
include fails...
Thank you for your patience...
Reproduce code:
---------------
// this is the calling code
...
// dict-lookup
$hits_per_page = 10;
include ('gobal/dict.php');
$arr = split ($dictsep, $search);
foreach ($arr as $token) {
...
Expected result:
----------------
dict.php cotains two arrays of key-value pairs and looks
like this:
<?
$dictsep = "[ \t\n\r<>,.:\(\)]";
$dict = array (
"ich",
"du",
"er",
"sie",
...
?>
These variables should be visible to the calling script,
which is for 'at' not the case.
Actual result:
--------------
The two 'imported' variables $dictsep and $dict are not
even set (isset on both resulted in false) for 'at'.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Mar 26 02:00:02 2026 UTC |
Put "error_reporting(E_ALL);" as first line on all files related. And also "var_dump(ini_get('include_path'));". You propably have some .htaccess files or vhost setting the include path to something else..error_reporting (E_ALL) showed no errors. var_dump(ini_get('include_path')) shows the expected result string(18) "/var/www/dannemann" but it does not work!You are right and I found the bug, sorry for the interruption, it was a typo: include ('gobal/dict.php'); the folder is called global - with l in it Sorry for any interruption, what a pity! Any chance to remove all reports and any trails... :)