php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40068 Warning: Unknown: failed to open stream: No such file or directory in Unknown..
Submitted: 2007-01-08 20:51 UTC Modified: 2007-01-10 22:43 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: triphius at tripslair dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.2.0 OS: FreeBSD 6.1
Private report: No CVE-ID: None
 [2007-01-08 20:51 UTC] triphius at tripslair dot com
Description:
------------
When loading any page on the web server, the user randomly gets presented with the following error:

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0

Fatal error: Unknown: Failed opening required '/path/to/script/here.php' (include_path='.:') in Unknown on line 0

This happens with every PHP script, and it appears to be totally random. The error message itself has no useful information to help determine the cause of the error.

The server in question is running FreeBSD 6.1 and Apache 1.3.37 and PHP 5.2.0.

Reproduce code:
---------------
As this problem occurs randomly on any script...it does not make sense to be a script issue.

Expected result:
----------------
The page to load normally, 100% of the time.

Actual result:
--------------
Sometimes the page loads normally, sometimes you get the error message as stated above.

Patches

martin (last revision 2013-12-27 11:10 UTC by martinmokry2 at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-01-08 20:53 UTC] iliaa@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Do you have any Zend or compiler cache extensions enabled?
 [2007-01-09 04:16 UTC] triphius at tripslair dot com
I installed PHP using FreeBSD's ports system. The configure command generated by the ports installer is as follows:

Configure Command =>  './configure' '--enable-versioning' '--enable-memory-limit' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection' '--enable-spl' '--program-prefix=' '--enable-fastcgi' '--with-apxs=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--enable-zend-multibyte' '--prefix=/usr/local'

I also installed the php5-extensions port with the following modules selected:

extension=ctype.so
extension=curl.so
extension=dom.so
extension=exif.so
extension=gd.so
extension=gettext.so
extension=iconv.so
extension=mbstring.so
extension=mcrypt.so
extension=mhash.so
extension=mysql.so
extension=mysqli.so
extension=openssl.so
extension=pcre.so
extension=pdf.so
extension=zlib.so
extension=pdo.so
extension=posix.so
extension=session.so
extension=simplexml.so
extension=snmp.so
extension=sockets.so
extension=tokenizer.so
extension=xml.so
extension=xmlreader.so
extension=xmlwriter.so

I am going to uninstall all of that and attempt to install from the CVS source as per your recommendation.
 [2007-01-10 03:53 UTC] iliaa@php.net
Please update the report once you have the results from the 
php-cvs run.
 [2007-01-10 05:40 UTC] triphius at tripslair dot com
I installed PHP from the CVS source as suggested, using the same configure command as FreeBSD had previously generated. Then I used the php5-extensions port to reinstall all the additional modules (as previously listed).

I have yet to see the random error (knock knock), and assume that this has fixed the issue. My guess is that there was a bug in the 5.2.0 release code used by the FreeBSD ports system.

I will update the bug report if I see any sign of the error. Thank you for your assistance so far.
 [2007-01-10 22:43 UTC] iliaa@php.net
Closing the bug as the problem is no longer reproducible 
(presumed resolved). 
 [2010-10-23 22:52 UTC] ttibensky at gmail dot com
I use Dreamweaver 8
when i save an index (index.php), it will automaticly save it as php5 file, so i save it manualy as php4 and that error is gone

so it must be some king of bug in php5...
 [2011-03-09 10:09 UTC] mook at social dot crabdance dot com
i can confirm the weirdness and roughly the error message. Hit refresh a few 
times here:
http://90.177.177.100/oldnagualnet.com/colors/red/
as opposed to here:
http://90.177.177.100/oldnagualnet.com/
colors being a directory with symlinks, red linking to ..
I ran wget in an endless loop on 
http://90.177.177.100/oldnagualnet.com/colors/red/colors.php and it errored 
roughly 3 times per second. After a while stopped. It doesnt seem to happen 
when the php is accessed by its address directly, only when its accessed thru a 
symlinked directory. 
This is:
Linux kook-desktop 2.6.32-5-xen-686 #1 SMP Mon Jan 17 10:49:18 UTC 2011 i686 
GNU/Linux
root@kook-desktop:/var/www/oldnagualnet.com# php -v
PHP 5.3.3-1ubuntu9.3 with Suhosin-Patch (cli) (built: Jan 12 2011 16:08:14) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
thanks .. :)

http://90.177.177.100/oldnagualnet.com/colors.php:
<?php
$file = $_SERVER["SCRIPT_NAME"];
preg_match("/\/colors\/(.*)\//", $file, $matches);
if(count($matches)==2)
$c = $matches[1];
else
$c="orange";

//print_r($matches);
?>
body { background-color:<?php echo $c ?>; }


UntitledFrame-2.php:

(lots of html)
<link rel="stylesheet" type="text/css" href="colors.php" />
(lots of html)
<?php
if ($handle = opendir('colors')) {
    while (false !== ($file = readdir($handle))) {
<------>echo "<a href=\"http://90.177.177.100/oldnagualnet.com/colors/$file\" 
target=\"main\">$file</a>\n";
    }
    closedir($handle);
}
?>
(some html)
 [2011-03-29 00:43 UTC] mook at social dot crabdance dot com
i broke the links. the new and hopefully more stable addresses are 
http://nagual.crabdance.com
vs 
http://nagual.crabdance.com/colors/red/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 02:01:29 2024 UTC