|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-12-03 12:08 UTC] max at kosyakov dot net
Description:
------------
realpath() returns path for the folder that does not exists.
First appeared on php-5.2.8 on FreeBSD 6.1. I have upgraded to php-5.2.1, however the bug persisted
%php -r '$test = "asdfasdf"; var_dump(realpath($test)); var_dump(file_exists(realpath($test)));'
string(27) "/usr/home/kosyakov/asdfasdf"
bool(false)
%php -v
PHP 5.2.11 (cli) (built: Dec 3 2009 17:26:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd.
%uname -imprsv
FreeBSD 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:32:43 UTC 2006 root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386 i386 GENERIC
%more /usr/soft/php-5.2.11/config.nice
#! /bin/sh
#
# Created by configure
'./configure' \
'--with-apxs2=/usr/local/apache2/bin/apxs' \
'--with-mysql=/usr/local/mysql' \
'--with-config-file-path=/usr/local/apache2/conf' \
'--with-gd' \
'--with-png-dir=/usr/local' \
'--with-jpeg-dir=/usr/local' \
'--with-freetype-dir=/usr/local' \
'--with-zlib-dir=/usr' \
'--with-iconv=/usr/local' \
'--enable-ftp' \
'--with-curl=/usr/local' \
'--with-openssl' \
'--enable-soap' \
'--with-pdo-mysql=/usr/local/mysql' \
'--with-mime-magic' \
'--enable-mbstring' \
'--without-sqlite' \
'--with-pdo-sqlite=/usr/local' \
'--enable-bcmath' \
"$@"
Bugs #43060 and #32627 look like the same bug but it is still reproducible.
Reproduce code:
---------------
---
From manual page: function.realpath#Description
---
$test = "asdfasdf";
var_dump(realpath($test));
var_dump(file_exists(realpath($test)));'
Expected result:
----------------
bool(false)
bool(false)
Actual result:
--------------
string(27) "/usr/home/kosyakov/asdfasdf"
bool(false)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 17:00:01 2025 UTC |
> %php -r '$test = "asdfasdf"; var_dump(realpath($test)); I guess | %php -r "var_dump(realpath('/non/existent'));" is returing false?What does this return: # php -r 'var_dump(realpath("/non/existent"));'Yes, it does return false: FreeBSD 6.1-RELEASE (GENERIC) #0: Sun May 7 04:32:43 UTC 2006 %php -r "var_dump(realpath('/non/existent'));" bool(false) %