php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41741 include/require fails for ../file
Submitted: 2007-06-19 20:11 UTC Modified: 2007-07-04 01:00 UTC
Votes:4
Avg. Score:5.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:1 (25.0%)
From: tobi at byte23 dot net Assigned:
Status: No Feedback Package: *Directory/Filesystem functions
PHP Version: 5.2.3 OS: NetBSD 3.1.0 stable
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-06-19 20:11 UTC] tobi at byte23 dot net
Description:
------------
Since the last update of my NetBSD system to PHP 5.2.3 all includes of the type include("../file.php") are denied.

For example: in file /foo/subdir/alpha.php I want to include /foo/beta.php the following error occurs:

---
Warning: require(../beta.php) [function.require]: failed to open stream: Permission denied in /foo/subdir/alpha.php on line 2

Fatal error: require() [function.require]: Failed opening required '../beta.php' (include_path='.') in /foo/subdir/alpha.php on line 2
---

Following things are checked twice: The filepermissions are OK, Apache (and every other user) can execute and read them. Directory permissions are aswell OK.

PHP Configuration is set to default settings. As I said everything worked totally fine since the latest update.

Thanks to everyone!

Reproduce code:
---------------
in /foo/subdir/alpha.php :

require("../beta.php");

Expected result:
----------------
Should include the file...

Actual result:
--------------
Permission denied, whereas all permissions are set totally OK and configuration is set to default settings.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-06-19 20:17 UTC] tobi at byte23 dot de
I should add the following: The errors don not only occur on self written codes but on every Wordpress and Typo3 installation on this server.
 [2007-06-19 20:25 UTC] tobi at byte23 dot net
NetBSD 3.1.0 not 3.0.1

sorry, it's my first bug report ;)
 [2007-06-25 13:42 UTC] michael at chunkycow dot com dot au
<quote>For example: in file /foo/subdir/alpha.php I want to include
/foo/beta.php the following error occurs:</quote>

Works fine here on CentOS4.5, kubuntu Fiesty and latest debian linuxes.
Can you include files from a subdirectory of the current one aka /foo/subdir/subsubdir/ ?
 [2007-06-26 16:07 UTC] tobi at byte23 dot net
Yes I can include files from subdirs...

I downgraded to PHP4 again (now it works...) but that's not an appropriate solution I think.

I think in the NetBSD pkgsrc there already is the latest PHP stable version...
 [2007-06-26 16:43 UTC] sniper@php.net
Please try the provided packages. We do not support any "ports".

 [2007-07-04 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Tue Sep 28 18:03:37 2021 UTC