I’m having a a pain in the head using the ABSPATH
constant in Windows.
Addressing files and folders in Windows is usually done using the (forward-slash) character while for Linux the character would be
/
(backslash).
Unfortunately the ABSPATH
in WordPress is defined with only Linux in mind (putting a /
at the end of it).
I wonder if I can over-ride it’s definition since in wp-config.php
it’s defined under an if
clause which indicates it can be defined elsewhere.
Problem detalis:
- I’m running on
localhost
- The problem is with the
statpress-visitors
internal addressing.
This is how it addresses the files:
ABSPATH . 'wp-content/plugins/' . dirname(plugin_basename(__FILE__)) . '/def/os.dat'
And this is what I get as output:
C:wampwwwwp/wp-content/plugins/statpress-visitors/def/os.dat
Windows does support both styles of slashes in path.
I am not sure if
ABSPATH
definition is safe to edit:wp-config.php
Myself I just use it as is, or replace slashes to make them uniform when putting path together. If that doesn’t work for you please provide specific examples where this causes issues.