How To Make Stattraq Work
Those of you who have WordPress 2.7, or indeed later versions of 2.6, might find that the latest version of Stattraq (1.2.6.4) plugin does not install and provides the following error when you visit the install page:
Warning: main(ABSPATH/wp-config.php) [function.main]: failed to open stream: No such file or directory in /home/xxxxxx/xxxxxx/public_html/wp-content/plugins/wp-stattraq/stattraq-install.php on line 19
Fatal error: main() [function.require]: Failed opening required ‘ABSPATH/wp-config.php’ (include_path=’.:/usr/share/pear’) in /home/xxxxxx/xxxxxx/public_html/wp-content/plugins/wp-stattraq/stattraq-install.php on line 19
There is a way to solve this problem and it is pretty simple.
You will need to edit the stattraq-install.php file. Don’t panic though because it really is very simple to do and it is only one line.
1. Open stattraq-install.php
2. Find the offending line (in my example it says line 19)
3. You should see:
require_once(ABSPATH.'/wp-config.php');
4. Remove it and add:
$path = '/home/xxxxxx/xxxxxx/public_html/';
require_once($path.'/wp-config.php');
The ‘/home/xxxxxx/xxxxxx/public_html/’ part should be the server path to the folder directory that you have WordPress installed in.
5. run the stattraq-install.php file and it should work now.
Let me know how this worked for you.



I am a 33 year old full-time freelancer & blogger from East London, United Kingdom, who has been working online since early 2001.
{ 8 comments… read them below or add one }
Aah!! That was so easy.
I thought that will be very difficult.
Thanks a lot for sharing the article.
I’m glad you found it helpful.
Thanks for dropping by.
Just a quick update, I have not been able to get this to work if the blog is in a sub folder.
Just thought I'd mention the new version 1.3 does not fix this problem but the solution I provided still works for it.
try
$path = = $_SERVER['DOCUMENT_ROOT'];
Thanks for your help.
I haven’t tried this though as I have long since abandoned the plugin in favour of Google Analytic.
I ever get the same problem and I have solve it too. Thank you for remind me.
You still use Stattraq? Has it changed much? I stopped using it about two years ago.