471,354 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

Problem with __FILE__ magic constant

We picked up a helpdesk script from sourceforge, Mantis. This script
uses the __FILE__ magic constant to ostensibly derive the path to the
include directory from a script in the top level directory.

Reading the doc about __FILE__ did not gain me enough insight as to what
is going on.

My testbed is running PHP 4.1.0 but the server where it is to run is
4.0.6. The script specifically says that it is designed for a minimum

In 4.1.0, the __FILE__ constant is set to the full path to the running
script starting from the root:
In 4.0.6, the __FILE__ constant is set to only: /script.php

My question is regarding the history of __FILE__ between these releases
and whether there is any way to influence what is returned by __FILE__?
I could change the script for our purposes but before I even think of
that, I was wondering if there were PHP options that affect this behavior.

As far as upgrading the 4.0.6 to a higher release, I could ASK but the
server is not mine (or I'd likely be at the 4.3.x level.)


Christopher J. Pomasl Starband 360, 004/68 Suse Linux 8.0 + KDE 3.1.2
Bari, Sound of the Rockies Chorus Lead, Gimmick quartet
Senior Software Engineer - DB2 products Computer Associates, inc
Always remember, you are unique.....just like everyone else!!
To email me, remove the spam stuff from my eddress
Jul 17 '05 #1
0 1744

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Chris Pomasl | last post: by
9 posts views Thread by qazmlp | last post: by
19 posts views Thread by youpak2000 | last post: by
18 posts views Thread by Lukas Ruf | last post: by
4 posts views Thread by allan.mcrae | last post: by
10 posts views Thread by klenwell | last post: by
10 posts views Thread by oktayarslan | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.