<TYPE YOUR MESSAGE HERE, ENTER SYSTEM DETAILS BELOW>
<Please check the G2 FAQ (sticky topic in this forum) before posting!>
----
Gallery URL (optional):
Gallery version: G2 "dark fibre"
Webserver (with version): apache 1.3
Datatabase (with version): mysql standard 4.0.23
PHP version (eg 4.2.1): 5.0.3
phpinfo URL (optional):
Graphics Toolkit(s): netpbm
Operating system: Mac OS X
Web browser/version: Firefox 1.0.1
G1 version (for migration bugs): none
Hi
I get the following error message in the System Checks
FILE directive supported Failed
Error: your PHP __FILE__ directive is not functioning correctly. Please file a support request with your webserver administrator or in the Gallery forums.
What can I do about this?
Thanks
Lukas
Posts: 32509
Very strange. Can one disable the __FILE__ directive?
If your php version was 4.0.3, then i could imagine that this error can occur, because there were some strange issues with __FILE__ in 4.0.x, but with 5.0.3 this should not occur.
I also couldn't find any issues related to the combination 5.0.3/mac os x and __FILE__.
perhaps mindless or bharat know more.
starting points:
http://ch2.php.net/constants
http://ch2.php.net/manual/en/language.constants.predefined.php
http://bugs.php.net/bug.php?id=13936&edit=3 (bugs in __FILE__ directive in 2001, php version 4.2)
Posts: 2
i get the same bug also with php 4.3.10
lukas
Posts: 7994
As far as I can tell, this is a bug in PHP. It's not one that we can work around, so if __FILE__ is broken there's not much we can do about it. If you give me ssh access to your box I can take a look and see if I can figure out what's going wrong (but the odds are that I won't be able to do anything since we check everything we can in the system check page).
Posts: 141
I also get this error with PHP Version 4.3.10.
G2 source code checked out via cvs about 10 minutes ago.
Posts: 141
PS: An already running and yesterday via CVS updated G2 installation is still running!
I've tryd to disable the FILE Check through deleting the section in SystemCheck.class (or so... If I remember the filename correctly.. but u should know what I mean ). Then the Install process went on to write config.php. But this fails... of course, config.php exists and was writeable, but the installer says always that its not.
Maybe this cames from the FILE problem.
Posts: 32509
rakso, the __FILE__ directive is too fundamental to ignore it. it's used in about every source file of G2. fix your php install, without passing the __FILE__ test, you'll end up with numerous of other errors during runtime.
Posts: 141
Hm ok.. but I have (unfortunately) NO idea HOW to fix it!
(And the already installed G2 works!)
Posts: 32509
get another php version, or the same version, fixed source, recompile or get a binary version. eg. 4.3.11 or a 5.0.x.
Posts: 141
Okay, now I've installed PHP 4.3.11, but the same problem...
What is the "__FILE__ directive" ?? Where can I find information about it?! I've never heard about this before...
The other G2 installation stills runs...
Posts: 8601
http://www.php.net/manual/en/language.constants.predefined.php
Posts: 141
hm.. I'm not a programmer, so this is not very useful for me...
But.. WTF dont work it...
Posts: 141
I don't have a solution yet.
How can a DEBUG-mode in gallery2 (installer) enbabled?
I hope, that I can see then more information about this failure...
Posts: 3236
Did you restart apache after you made changes / updated php?
Posts: 32509
debug mode is enabled in config.php (open config.php with a texteditor (wordpad,...) and change the debug mode line from false to buffered.
BUT... this won't help you in this case. the __FILE__ directive has nothing to do with G2, it's a fundamental PHP functionality. all we can say is that you should try other versions of php. perhaps the newest php from the 5.0.x series.
Posts: 141
inapprehensible.... verdammte scheisse.... *fluch*
With the fresh installed PHP 5.0.4 (FreeBSD ports) its the same problem.
In install/steps/SystemChecksStep.class there is the following code of interest:
function CheckFileDirective() {
if (strstr(__FILE__, 'install/steps/SystemChecksStep.class') ||
strstr(__FILE__, '\\install\\steps\\SystemChecksStep.class')) {
return true;
} else {
return false;
}
}
If I write above the if (...)
die('__FILE__ = ' . __FILE__);
then in the browser appears
__FILE__ = ./steps/SystemChecksStep.class
Now its clear why the check fails... because it checked for
install/steps/SystemChecksStep.class
__FILE__ should return a realative path.
maybe can the Gallery2 developers change a little bit the behaviour of their software? I cant beliefe that this g2 installer works on a server out in the world?!
Posts: 32509
rakso, no, that's not true.
see: http://ch2.php.net/manual/en/language.constants.predefined.php
__FILE__ should return the full path, that is the absolute path, of the file where it's called in.
__FILE__ returning a relative path is a known php problem and should have been fixed by now.
it seems that PHP couldn't fix it for all system, i.e. obviously it doesn't work on your freebsd machine.
please file a PHP bug and talk to them.
http://bugs.php.net/
Posts: 141
I have!
Until now nothing happend...
What can I do to install a new gallery2 instance?
Ohhhnooo....
Posts: 7994
Rakso, what's the url to the bug you filed? We'll try to get some PHP devs to look at it.
Posts: 141
http://bugs.php.net/bug.php?id=32967
Thanks!
Posts: 141
I have tryd the test posted in http://bugs.php.net/bug.php?id=27823 :
--- test.php
<?php
print __FILE__;
print "<p>";
require("test2.php");
?>
--- test2.php
<?php
print __FILE__;
?>
The output is (as expected)
/home/whatever/www/test.php
/home/whatever/www/test2.php
Posts: 32509
rakso, and you still get the warning in G2?
if so, here's a more complicated test case:
create in /home/whatever/www/test.php
and in /home/whatever/www/sub1/testsub1.php
and in /home/whatever/www/sub1/sub2/testsub2.php
--- test.php
--- testsub1.php
--- testsub2.php
Expected Result:
-------------------
/home/whatever/www/test.php
/home/whatever/www/sub1/testsub1.php
/home/whatever/www/sub1/sub2/testsub2.php
works on linux (gentoo), apache 2, php 4.3.11.
if this test fails, add this test to the bug.
Posts: 141
I get the same result as you... but in another virtual host!!
In the vhost of the gallery2 installer, I get:
/home/whatever/www/tmp/test.php
./sub1/testsub1.php
./sub1/sub2/testsub2.php
and, of course, the gallery2 installer still fails...
curious!
Now I try to find out the difference between them.. .?!
Posts: 32509
rakso, different vhosts? what's different? the filesystem? some apache configs?
however, please post my more complicated test to the php bug and tell them about all differences you find between the vhosts.
does phpinfo return different results on the two vhosts? etc.
Posts: 141
ok, these information are now posted...
unfortunately, I cant found any differences...
Posts: 32509
rakso,
that's the last message of the php guy and you didn't answer / follow his instructions. probably you should do so now and answer, because how should he help you, if you don't work together?
Posts: 141
Of course!
But as you and he can see in the postet list of extensions, there is no zend_extension.so.
Posts: 32509
you didn't answer him etc.
i'm just saying that the next thing he will say could probably be "please do what i told ya"
Posts: 141
ok ok
Posts: 4
I'm having this problem too. I created the test files and the result is as expected:
I'm using Mac OS X with PHP Version 5.0.4 installed. Already restarted Apache and also tried to install using Firefox and Camino, btw.
And how do you disable modules (as explained here)?
Posts: 32509
you get the system check failure about __FILE__ in g2?
please post a screenshot.... hard to believe given that the test script runs perfectly.
next thing you'll have to do is adding print statements in install/steps/SystemChecksStep.class
Posts: 4
Here's the error message and here's test result.
Posts: 32509
then you'll have to find out why our test in install/steps/SystemChecksStep.class say it isn't working correctly.
find:
in this file and add
print __FILE__; exit;
before return false;
Posts: 4
What I got now is
huh?
Posts: 32509
which is obviously not an absolute path!
can't help you there. obviously __FILE__ doesn't work reliably in your environment.
why it works in the test script, i don't know.
Posts: 4
Bummer…
Anyways, thanks for keeping up with me. I really appreciate that.