php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36673 include fails without reason
Submitted: 2006-03-09 18:51 UTC Modified: 2006-03-21 16:08 UTC
From: edoardo at serra dot to dot it Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.1.2 OS: Linux 2.6 (FC4)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: edoardo at serra dot to dot it
New email:
PHP Version: OS:

 

 [2006-03-09 18:51 UTC] edoardo at serra dot to dot it
Description:
------------
I have a web application needing write permissions on a directory.

I decided to recursively chown that directory to nobody (the user the webserver is running as) 

As I chown 'chown -R nobody layout/' I get:

Warning: include(layout/theme.php) [function.include]: failed to open stream: No such file or directory in /......./html/header.php on line 35

Warning: include() [function.include]: Failed opening 'layout/theme.php' for inclusion (include_path='.:/usr/local/lib/php') in /......./html/header.php on line 35

line 35 is: include("layout/theme.php");

Needless to say the file is existent

# ll layout/theme.php
-rw-r--r--  1 nobody web 31413 Mar  9 16:03 layout/theme.php

As I chown the dir back to the owner of header.php it start working again...

# chown -R web layout/
# ll layout/theme.php
-rw-r--r--  1 web web 31413 Mar  9 16:03 layout/theme.php

Safe mode is off

Reproduce code:
---------------
Cannot find a few lines of code reproducing the bug, should see the whole application

Expected result:
----------------
I expect to have the page included without problems

Actual result:
--------------
Warning: include(layout/theme.php) [function.include]: failed to open stream: No such file or directory in /......./html/header.php on line 35

Warning: include() [function.include]: Failed opening 'layout/theme.php' for inclusion (include_path='.:/usr/local/lib/php') in /......./html/header.php on line 35

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-09 19:01 UTC] tony2001@php.net
Does it work if you specify absolute path?
 [2006-03-09 19:16 UTC] edoardo at serra dot to dot it
Using an absolute path give a more useful error message
that make me notice safe mode is on on that VHOST

Sorry for my mistake, but the "file not found" error message, not indicating a SAFE MODE problem, was confusing for me.

Do you still consider it a bug ?

Output with full path 

Warning: include() [function.include]: SAFE MODE Restriction in effect. The script whose uid is 1000 is not allowed to access .....

Warning: include(/.../theme.php) [function.include]: failed to open stream: Success in /.../header.php on line 35
 [2006-03-21 16:08 UTC] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Safe mode restriction preventing file from being opened.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 11:01:33 2025 UTC