php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45835 include and symlinks
Submitted: 2008-08-16 20:22 UTC Modified: 2008-08-18 10:29 UTC
From: hannes dot magnusson at gmail dot com Assigned: dmitry (profile)
Status: Closed Package: CGI/CLI related
PHP Version: 5.3CVS-2008-08-16 (snap) OS: Ubuntu 8.04.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: hannes dot magnusson at gmail dot com
New email:
PHP Version: OS:

 

 [2008-08-16 20:22 UTC] hannes dot magnusson at gmail dot com
Description:
------------
Looks like the new realpath() implementation is having issues with symlinks..

include_once with symlinks in the path, under lighttpd, is failing.
Can't seem to reproduce this under cli.

/www/bjori.php.is is a symlink to /www/local.php.net
/www/local.php.net is then a symlink to /home/bjori/php/web

Using the realpath of the file, or relative path, works fine.

Reproduce code:
---------------
bjori@lindsay:~/php/5.3$ cat config.nice
#! /bin/sh
#
# Created by configure

'./configure' \
'--prefix=/home/bjori/.apps' \
'--enable-debug' \
'--with-zend-vm=GOTO' \
'--disable-all' \
'--without-pear' \

bjori@lindsay:~/php/web$ cat test.php 
<?php
var_dump(file_exists("/www/bjori.php.is/test/inc.php"));
include  "/www/bjori.php.is/test/inc.php";

bjori@lindsay:~/php/web$ cat test/inc.php 
hello world


Actual result:
--------------
bool(true)
Warning: include(/www/bjori.php.is/test/inc.php) [function.include]: failed to open stream: No such file or directory in /home/bjori/php/web/test.php on line 3


Sometimes: 
bool(true)
Warning: include(/www/bjori.php.is/test/inc.php) [function.include]: failed to open stream: Success in /home/bjori/php/web/test.php on line 3

And even the occasional:
Fatal error: Unknown: Failed opening required '' (include_path='.:') in Unknown on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-08-18 10:29 UTC] dmitry@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

This bug must be already fixed 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 15:01:31 2024 UTC