user1801410
user1801410

Reputation: 39

After upgrading to Xampp 1.8.1, can't view my sites

I was using xampp 1.7.0 but just decided to upgrade to xampp 1.8.1. I uninstalled the 1.7 but didn't uninstall the htdocs and mysql server.
I now installed 1.8 and create passwords for the xampp directory and mysql through the xampp security page. Unfortunately, I can't view my sites again, they all give errors, this is a sample error:

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\3nity\libraries\joomla\import.php on line 29
Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\3nity\libraries\loader.php on line 71
Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\3nity\libraries\joomla\import.php on line 32
Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\3nity\libraries\loader.php on line 71
Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\3nity\libraries\loader.php on line 138
Strict Standards: Non-static method JRequest::clean() should not be called statically in C:\xampp\htdocs\3nity\libraries\joomla\import.php on line 33
Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\3nity\libraries\joomla\environment\request.php on line 463

Please what can I do because i don't have a backup of all the sites, 5 years of hard work with a current clients project at hand now.

I use a win 7 operating system 64bit, used xampp-win32-1.8.1-VC9-installer.

Upvotes: 2

Views: 4056

Answers (2)

Timo Tijhof
Timo Tijhof

Reputation: 10279

This is likely due to a different (newer) version of PHP in the latest XAMPP. PHP 5.4 (PHP 5.4.7 to be exact) is more strict about warning for bad code.

The real problem is in the actual PHP code (either yours or code used in a package use use, like Joomla).

If it is coming from your code, you should fix it. Do so by accessing a static method property or property in a static way (e.g. class Foo { public static $bar = 123; } and Foo::$bar to access it, and class Bar { public static function foo() { } } and Bar::foo() to invoke it. Note how we use :: instead of ->. This means there is no active instantiation state. In other words, $bar = new Bar(); $bar->foo(); is incorrect as it calls it as a instance method instead of statically through Bar::foo().

Likewise, if the problem is the other way around, the developer may have to declare a method as static if it is stateless and called statically.

For the Joomla case it seems there are various reports about it already:

(Found by pasting the error in Google!)

Learn more about the difference between state and static:

If you only have warnings (not errors), learn about error_reporting and disable these innocent warnings (by lowering the error reporting level). That way you reduce the noise and can focus on other things.

During development you should probably not hide any warnings and so that you can spot them and improve your code. But in production it may be better to hide the warnings and only log errors.

Upvotes: 2

user1801410
user1801410

Reputation: 39

After going through all the information and links presented, I was able to overcome the strict standard issue. The changes I made earlier didn't reflect because I was changing the values at the wrong line. This is what I did: I had to edit line 535 & 552 of my php.ini file and set display errors to OFF and also used this setting: error_reporting = E_ALL & ~E_NOTICE. Both Joomla 1.5 and 2.5 sites don't give errors again. Thanks to everybody.

Upvotes: 0

Related Questions