ID: 21310 Comment by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: *Directory/Filesystem functions Operating System: Solaris 8 PHP Version: 4.3.0 New Comment:
I've also experienced the same problem on Solaris 8, w/ PHP 4.3.0, but haven't been able to duplicate it on Linux. The problem occurs when running scripts through the web, but the problem doesn't occur when running from the CLI. For me it has nothing to do w/ permissions--same problem even if the files/directories have full RWX permissions set. For all of you dealing w/ this issue, a workaround I'm using so I don't have to hard-code the full path in scripts is something like: require(dirname($_SERVER['SCRIPT_FILENAME']).'/../lib/test.php'); That works both from web and CLI. Previous Comments: ------------------------------------------------------------------------ [2003-02-04 16:52:55] [EMAIL PROTECTED] I am able to duplicate this on Solaris 8, Apache 1.3.27, PHP 4.3.0. I traced it to getcwd() (aka VCWD_GETCWD) returning null, and errno=EACCES in fopen_wrappers.c:expand_filepath(). The same code works on 4.2.3. However, this test was done in a non-standard environment using Kerberos and a distributed file system, so this test may not be representative. For those of you experiencing this problem, check to see that there is read perms on the afflicted directory and all ancestors. ------------------------------------------------------------------------ [2003-01-23 06:41:04] [EMAIL PROTECTED] Not to jump in.. Theres a cron job i've been running on a few servers and it's survived quite a few php upgrades. I tested php4.3.0 on one of those servers (upgrading cli from 4.2.3) and now the cron job refuses to run. Same issue as above. It appears the cli is not honoring include path. (My path has a . (dot), and relative paths from the directory of the script do not work after the upgrade. The application running on the webserver works fine on 4.3.0. ------------------------------------------------------------------------ [2003-01-17 20:10:38] [EMAIL PROTECTED] oops.. ------------------------------------------------------------------------ [2003-01-17 10:41:19] [EMAIL PROTECTED] [EMAIL PROTECTED]: Instead of spamming the bugdb with your theories, *please* respond to our requests for more information in your own bug report. We need *facts* to be able to fix the problem, and so far you haven't given us any. ------------------------------------------------------------------------ [2003-01-17 10:21:26] [EMAIL PROTECTED] I reported this same problem aka. (BUG) at Bug# 21674 I too was told this is not a bug. I just upgraded to 4.3.0 from 4.1.2. This problem did not previously exist. I'm getting the exact same messages. Why hasn't the tech group at php.net not recognized that this is, in fact, a bug? Too many reported occurences and all seem related to 4.3.0. The issue is related to "include_path". In my case, I have a file located at /home/sites/site2/web/IV/config.php The above file contans the following lines: include_once ('lang.php'); include ('extras.php'); I have another script located at /home/sites/site3/web/powerpage.php -----> which contains the following lines: <---- require_once ("/home/sites/site2/web/IV/config.php"); langtop(); At first I thought it was a permissions issue. But then I rechecked my debug process and found the errors are still occuring. (Actually they appeared with another script of was testing that does similar path includes.) 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 This is my guess. PHP 4.3.0 now incorporates Stream functionality to allow for references such as https or ssl: I think that somewhere in this functionality, there was introduced a hard dependency on absolute file paths that have now negatively impacted on include functions calls such that if the include does not reference a file in the same exact path as the calling script, the above referenced errors will return indicating a failure to create the stream connection to the requested file. Just a guess. Im not a php guru. But I do know common sense. How can all of us who have been affected by this, fix this annoying problem? Is it an issue with the PHP.ini file? Is it an issue with the build process? Are we now required to use absolute paths for all required includes or require functions. Notice: in my case my require_once does not error because I have referenced the absolute path. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/21310 -- Edit this bug report at http://bugs.php.net/?id=21310&edit=1