#45835 [NEW]: include_once ans symlinks

[email protected] ("hannes dot magnusson at gmail dot com")
Newsgroups php.bugs
Message-ID <[email protected]>
From:             hannes dot magnusson at gmail dot com
Operating system: Ubuntu 8.04.1
PHP version:      5.3CVS-2008-08-16 (snap)
PHP Bug Type:     CGI related
Bug description:  include_once ans symlinks

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

-- 
Edit bug report at http://bugs.php.net/?id=45835&edit=1
-- 
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=45835&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=45835&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=45835&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45835&r=fixedcvs
Fixed in release:             http://bugs.php.net/fix.php?id=45835&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45835&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45835&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45835&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45835&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45835&r=notwrong
Not enough info:              http://bugs.php.net/fix.php?id=45835&r=notenoughinfo
Submitted twice:              http://bugs.php.net/fix.php?id=45835&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45835&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45835&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45835&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45835&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45835&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45835&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45835&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45835&r=mysqlcfg
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.