php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42826 Random problem with accessing file by php runtime
Submitted: 2007-10-02 10:21 UTC Modified: 2007-11-17 02:01 UTC
From: lahcim at fajne dot com Assigned:
Status: Closed Package: Apache related
PHP Version: 5.2.4 OS: FreeBSD 6.2-STABLE
Private report: No CVE-ID: None
 [2007-10-02 10:21 UTC] lahcim at fajne dot com
Description:
------------
I found similar bug here: #41476

It is exactly the same problem.

Randomly I am getting error:

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

Fatal error: Unknown: Failed opening required '/home/www/main/wybranski.com/wybranski.com/data/photos/2006.04 FoodExplorer/slides/IMG_0366.html' (include_path='.:/usr/local/share/pear') in Unknown on line 0

While the path is 100% correct and the file exists!
After refreshing the same webpage it works.

You can see that I have associated also .html files to be parsed as php but it also happens for pure php files.

I remove the php.ini completly, so it runs with default configuration.

The only extensions I have are:
extension=gd.so
extension=imap.so
extension=mysql.so
extension=ldap.so

but the bug also happens when there are no extensions loaded, so it is php apache module bug.

I could not repro this bug on CLI, it happens only with apache module.



Reproduce code:
---------------
It seems that it happens on this particular configuration:

PHP 5.2.4 with Suhosin-Patch 0.9.6.2 (cli) (built: Oct  2 2007 12:01:40) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

Server version: Apache/1.3.37 (Unix)
Server built:   Sep 24 2007 20:07:19

FreeBSD plustech.pl 6.2-STABLE FreeBSD 6.2-STABLE #1: Mon Aug 20 14:53:07 UTC 2007     root@plustech.pl:/usr/obj/usr/src/sys/GTT  amd64

I have the same configuration on a different server, but on x86 machine and the problem does NOT happen on x86.

It seems that it can be a bug with php apache module compiled for amd64 architecture in particulary.

The bug happens "randomly". I do not know on which it depends.

To experience the bug please go to:
http://www.wybranski.com/photos/

and start reviewing the pictures one after another.

After some time the error will appear. Than after refreshing the same webpage it will be all ok.

But than when you continue reviewing other pages the bug will happen again.


Expected result:
----------------
The page that the bug is reporting as "Failed opening required" exists! So it should load it without saying that it has a problem.


Actual result:
--------------
It reports 'Failed opening required' error on a file that is present and available:

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

Fatal error: Unknown: Failed opening required '/home/www/main/wybranski.com/wybranski.com/data/photos/2006.04 FoodExplorer/slides/IMG_0366.html' (include_path='.:/usr/local/share/pear') in Unknown on line 0

(I enabled php for .html extensions but it also work /the bug happens also/ for pure .php files)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-02 11:14 UTC] jani@php.net
First of all get rid of any 3rd party patches / extensions / zend extension in your PHP build, such as any optimizers, caches and that suhosin patch.
 [2007-10-02 12:31 UTC] lahcim at fajne dot com
I removed the suhoshin patch.

Currently running on:
PHP 5.2.4 (cli) (built: Oct  2 2007 14:20:20) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies

It seems that the bug is fixed.

I am closing the bug. I will reopen if it starts to happen with the current configuration, but it seems that the suhoshin patch caused the problem.
 [2007-11-16 08:36 UTC] sesser@php.net
I am reopening this bug because it is nonsense that this bug is caused by the Suhosin Patch.

It is more likely that some 64 bit issue in PHP exists that is hidden by some obscure struct size but when Suhosin is activated it is suddenly visible.

 [2007-11-17 02:01 UTC] jani@php.net
It's also very likely that the patch itself has that issue. As long as that not proved -> closed.
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed May 18 07:05:45 2022 UTC