|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27823 __FILE__ still not working properly in includes under Solaris
Submitted: 2004-04-01 04:03 UTC Modified: 2005-02-11 01:00 UTC
Avg. Score:4.0 ± 1.3
Reproduced:9 of 9 (100.0%)
Same Version:2 (22.2%)
Same OS:3 (33.3%)
From: roy at pine dot nl Assigned:
Status: No Feedback Package: Scripting Engine problem
PHP Version: 4CVS-2004-04-29 OS: Solaris 7
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-04-01 04:03 UTC] roy at pine dot nl
The __FILE__ bug under Solaris ( is still there.
I tried the same script setup under FreeBSD and PHP 4.3.4 where it works like intended.

Reproduce code:
--- test.php
print __FILE__;
print "<p>";

--- test2.php
print __FILE__;

Expected result:


Actual result:



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-09 08:46 UTC] roy at pine dot nl
It seems to work with the CLI binary i compiled from .
 [2004-04-13 04:01 UTC] roy at pine dot nl
It also works with the 4.3.5 CLI binary.
 [2004-04-21 12:12 UTC] roy at pine dot nl
Alright we upgraded our production machine to
 (PHP Version 4.3.7-dev) in order to test the problem and it is not working.
 [2004-11-18 06:09 UTC] chiller at orchidsuites dot net
Same problem.  __FILE__ returns './filename' instead of '/path/to/filename'.

MacOS X Server 10.3.6 / PHP 4.3.9

It seems this bug keeps getting reintroduced.  IMO __FILE__ should return the full path.
 [2005-02-11 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".
 [2005-09-14 23:03 UTC] mmayer at blastwave dot org
It is still happening. I ran into it today, trying to install the newly released Gallery 2.

My system is a Sun Ultra 60, running Solaris 9. I also run Apache 2 and PHP 4.4.0.

I installed Gallery 2 under ~/public_html (i.e. in my home directory). When I moved it into the docroot of Apache, it started working.

I can also reproduce the problem with the two little scripts provided by roy. But only if the scripts are in a subdirectory of /home/markus/public_html. If they are in a subdirectory of the doc-root, everything is fine.
 [2006-07-05 04:56 UTC] kwerle at pobox dot com
Please see for the cause 
and solution
 [2006-07-19 01:42 UTC] wrhj at yahoo dot com
yeeah, you guys are right.
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Wed Dec 02 01:01:35 2015 UTC