#33529 [Opn->Fbk]: __FILE__ is relative while running Apache SAPI

From: Date: Tue, 23 Aug 2005 00:27:18 +0000
Subject: #33529 [Opn->Fbk]: __FILE__ is relative while running Apache SAPI
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83886@lists.php.net to get a copy of this message
ID: 33529 Updated by: sniper@php.net Reported By: ohill@php.net -Status: Open +Status: Feedback Bug Type: Scripting Engine problem Operating System: Mac OS X PHP Version: 5CVS, 4CVS (2005-07-03) New Comment: Can you explain me why I can't reproduce this on same Macosx version, same apache version and PHP 4.4.0 ?? (yes, I tested within a virtualhost and a subdir in it) Does your setup have some symlinks somewhere in the path? Previous Comments: ------------------------------------------------------------------------ [2005-07-03 01:58:32] ohill@php.net Yes, same result with 5.1.0-dev (indeed) ------------------------------------------------------------------------ [2005-07-02 15:45:37] sniper@php.net Does this happen with PHP 5.1-dev? http://snaps.php.net/php5-latest.tar.gz ------------------------------------------------------------------------ [2005-07-01 05:31:19] ohill@php.net If you try with 2 scripts: /index.php /something/index.php and /index.php contains print __FILE__ and /something/index.php contains include('../index.php'), if you point your browser to /index.php the content of __FILE__ is correct. If you try /something/index.php, __FILE__ will contains '../index.php' ------------------------------------------------------------------------ [2005-06-30 22:56:48] ohill@php.net Description: ------------ The content of the __FILE__ constant is relative while running through a Virtual Host on OS X. The bug is not seen while working with the CLI version or if the script is not in a VirtualHost directive. Configure is as follow (majorly taken from OS X compile flags): './configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--with-apxs' '--enable-cli' '--with-zlib' '--with-xml' '--enable-exif' '--enable-ftp' '--enable-sockets' '--with-curl=/usr' '--with-config-file-path=/etc' '--sysconfdir=/private/etc' Apache is the one distributed with Tiger 10.4.1 (1.3.33). The same code runs fine on Linux and Windows with the same config (vhosts settings). Reproduce code: --------------- <?php print __FILE__; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=33529&edit=1

« previous php.bugs (#83886) next »