Some of error from error-log
Lost connection to MySQL server during query SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts.post_type = ‘post’ AND (wp_posts.post_status = ‘publish’ OR wp_posts.post_status = ‘private’) ORDER BY wp_posts.post_date DESC LIMIT require(‘wp-blog-header.php’), wp, WP->main, WP->query_posts, WP_Query->query, WP_Query->get_posts
PHP Fatal error: Function name must be a string in /…./wp-content/plugins/wp-statistics/includes/functions/parse-user-agent.php on line 123
What version of PHP are you running? What version of WP Statistics did you upgrade from?
The first part of the error above (the Lost connection part) isn’t related to WP Statistics.
Hi,
I am also getting the same error at http://pragatiprakashan.in
Plugin could not be activated because it triggered a fatal error.
Fatal error: Function name must be a string in /…/wp-content/plugins/wp-statistics/includes/functions/parse-user-agent.php on line 123
Plugin version: 9.3.1
Hi,
Running PHP version: 5.4.41
Currently I have 9.3.1 installed. I am not sure what the previous one was.
Can you try disabling your other plugins?
Also try the following:
1. Create a “test.php” file in the “wp-statistics/includes/functions” folder in your WP plugins directory.
2. Add the following to the test.php:
<?php
include( 'parse-user-agent.php' );
print_r( parse_user_agent() );
?>
3. Access the file in a browser:
http://[Your site name]/wp-content/plugins/wp-statistics/includes/functions/test.php
It should output something like:
Array ( [platform] => Windows [browser] => Firefox [version] => 38.0 )
Hi Greg,
I tried disabling all other plugins, it’s still not working.
As for the PHP file it isn’t giving any output.
Can you check your PHP error log and see if the script generated the same error as the plugin?
If it did, it may be a bug in the version of PHP, does your hosting provider offer a newer version of PHP you can try?
Also check to see if your PHP install has eAccelerator.
Closing due to inactivity.
I’m having this same error. Tried test.php as you mentioned here. Getting blank page for that.
I’m running on php 5.4.42
Any help will be appreciated.
I replaced the “parse-user-agent.php“with another file from ver 7.0 (http://plugins.svn.wordpress.org/wp-statistics/tags/7.0/includes/functions/parse-user-agent.php) and everything is working fine now.
Hope this may help someone.
Libin: are you using eAccelerator? If so it’s a bug in eAccelerator.
If not, can you try a different version of PHP from your hosting provider?
eAccelerator is not installed. I think 5.4.42 is a stable version. I will try to get a new php version.
I changed the php version and It is fine. Ran into some other problems with the theme wich I am working on. Thanks for the help.
@ensiyeh: No problem, there seems to be a bug with anonymous functions in PHP 5.4.? but I can’t reproduce it on my 5.4 install so it’s hard to track down.
@libin: Let me know if you have any success with the new version.
I’m going to do some work on the user parsing code to get rid of the anonymous function call and submit it back to the original author of the library.