|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-01-15 22:10 UTC] moderator at blackpeeps dot com
Warning: main(lang.php) [function.main]: failed to create stream: No such file or directory in /home/sites/site2/web/IV/config.php on line 97
Just upraded to 4.3.0 from 4.1.2
Issue involves the following:
Same server
Two (2) seperate virtual domains
Scripts worked find before upgrade.
I am running a local php script located at
/home/sites/site3/web/powerpage.php
powerpage.php has a line that does a require_once to a remote file config.php located on (same server) located at
/home/sites/site2/web/IV/config.php
Sample:
require_once ("/home/sites/site2/web/IV/config.php");
langtop();
The followng errors occur when I now try to run this local script
Warning: main(lang.php) [function.main]: failed to create stream: No such file or directory in /home/sites/site2/web/IV/config.php on line 97
Warning: main() [function.main]: Failed opening 'lang.php' for inclusion (include_path='') in /home/sites/site2/web/IV/config.php on line 97
Warning: main(extras.php) [function.main]: failed to create stream: No such file or directory in /home/sites/site2/web/IV/config.php on line 98
Warning: main() [function.main]: Failed opening 'extras.php' for inclusion (include_path='') in /home/sites/site2/web/IV/config.php on line 98
Fatal error: Call to undefined function: langtop() in /home/sites/site3/web/powerpage.php on line 3
Problem: The file does exist
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 16:00:01 2025 UTC |
Test this code if you will: // Start- Copy and Save this code as phpbug21674.php in a path folder name "site3" <? // PHP BUG# 21674 // This script must be saved to Docs root path of virtual domain-A // To debug.. change the path to the path on your test server require_once ("/home/sites/site2/config.php"); echo "Hello - Testing PHP 4.3.0 bug# 21674<br>"; ?> // End - Copy and Save this code as phpbug21674.php // Begin - Copy and Save this code as config.php in a path folder name "site2" <? include ('extras.php'); ?> // End - Copy and Save this code as config.php // Begin - Copy and Save this code as extras.php in a path folder name "site2" <? // -- field definitions -- $extra=array(); // leave this line alone $extra[info1][name]="Alias Name/Nickname"; $extra[info1][type]="text"; $extra[info2][name]="Your Gender"; $extra[info2][type]=array("Female","Male",); $extra[info3][name]="Relationship Status"; $extra[info3][type]=array("Single","Single-Looking for Couples","Couple-Looking for Singles","Dating","Involved/Partner","Involved-Seeking New Friends","Married","Married-Seeking Discreet Friend","Engaged","Divorced","Widowed","Player","Just looking for friend","Just Looking for Sex Partner","Undecided"); $extra[info4][name]="Sexual Orientation"; $extra[info4][type]=array("Heterosexual","Gay","Lesbian","BiSexual","BiCurious","Rather Not Say"); // do not edit past this line $extras = array(); for ($i=0; $i < 21; $i++) { $marker = "info".$i; // print $marker."<br>"; // debug if (strlen($extra[$marker][name]) > 1) $extras[]=$marker; } // in general, to display extra variable values, use $extra[infox][value] ?> Now execute php21674.php to reproduce errors.add: var_dump(ini_get('include_path')); to the line before the require_once in the phpbug21674.php script and paste the output here.and can you confirm that the var_dump(ini_get('include_path')) is on the line immediately above the include that fails? I'm asking because the line numbers in the report don't seem to have changed, and I would have expected them to at least have increased by 1.Just to be extra sure: in config.php, do lines 97 and 98 look like this: var_dump(ini_get('include_path')); include ('extras.php'); If not, please make sure they do and report back. If they do, then something really strange is going on.Hello Wez: Not it does not look like that. I was asked to include var_dump(ini_get('include_path')); before the require_once statement in the primary script, phpbug21674.php Remember there are two scripts located in different paths representing two different virtual domains. /home/site3/phpbug21674.php (contains a require_once ("/home/sites/site2/web/IV/config.php"); and /home/sites/site2/web/IV/config.php" ---> contains include_once ('lang.php'); include ('extras.php'); However, I did go back and also added the var_dump to config.php to reflect as follows: var_dump(ini_get('include_path')); include_once ('lang.php'); include ('extras.php'); Results: Same results = Failed to create stream: Again, this script worked fine on PHP 4.1.2 Now it seems to get it to work, I have to reference the absolute path.The point of asking for var_dump(ini_get('include_path')); is so you'll show the output of it. This is a form of debugging. The problem has to do with the include_path directive. Now we're trying to figure out why/where it gets set to '' before doing some of these includes as this seems to be the case. So, whenever you get this error: Warning: main() [function.main]: Failed opening 'foo.php'... Add this line above the include: var_dump(array(ini_get('include_path'),__LINE__,__FILE)); This way we'll know some useful information. Basically put this line above EVERY one of these failed includes, such as the inclusion config.php, extra.php, and lang.php. Please do this and show the output in your next reply. Btw, I modified Wez's debug dump a little so we can be a little more specific :) Also, be 100% sure you are not setting this directive in either httpd.conf or .htaccess.