[wp-hackers] Failing to find wp-config.php

Andy Skelton skeltoac at gmail.com
Wed Jan 25 14:01:15 GMT 2006


Okay, here's what I found with my testing:

In the shell, pwd was disabled. (Paranoid host?)

__FILE__ == 'test.php'
dirname(__FILE__) == 'test.php'
basename(__FILE__) == 'test.php'

This breaks wp-blog-header.php. I found a reliable test for this problem:

!file_exists(dirname(__FILE__).'/'.basename(__FILE__))

And a reliable method of setting ABSPATH in this case:
define('ABSPATH', dirname($_SERVER['SCRIPT_FILENAME']).'/');

What I still don't know is why the $*%@ thing acts this way.

Andy


More information about the wp-hackers mailing list