Fix lỗi Joomla "Strict Standards: Non-static method JLoader::import() should not be called statically ..."

Khi bạn cài đặt Joomla sau đó xóa thư mục "installation", hoặc bạn chuyển đổi host cho Joomla , sau đó bạn mở website của bạn lên có thể bạn sẽ gặp phải hàng loạt thông báo lỗi "Strict Standards: Non-static method JLoader::import() should not be called statically " .
 
Tình trạng lỗi mà tôi gặp phải như sau :
Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\import.php on line 29

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 71

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\import.php on line 32

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 71

Strict Standards: Non-static method JLoader::load() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 161

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 138

Strict Standards: Non-static method JRequest::clean() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\import.php on line 33

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\environment\request.php on line 467

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\environment\request.php on line 468

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\environment\request.php on line 469

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\environment\request.php on line 470

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\environment\request.php on line 471

Strict Standards: Non-static method JRequest::_cleanArray() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\environment\request.php on line 472

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\import.php on line 35

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 71

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\import.php on line 38

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 71

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\import.php on line 39

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 71

Strict Standards: Non-static method JLoader::load() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 161

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 138

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\import.php on line 46

Strict Standards: Non-static method JLoader::register() should not be called statically in C:\xampp\htdocs\diaoc\libraries\loader.php on line 71

Strict Standards: Non-static method JLoader::import() should not be called statically in C:\xampp\htdocs\diaoc\libraries\joomla\import.php on line 47

Cách khắc phục :
Mở file php.ini  (Đối với XAMPP nó nằm ở : "C:\xampp\php" còn với EasyPHP nó thuộc thư mục "EasyPHP-5.3.3.1\conf_files\" ) và lần lượt thực hiện các thay đổi sau :

- Đổi "error_reporting = E_ALL | E_STRICT" bằng "error_reporting = E_ALL & ~E_STRICT"
- Đổi "display_errors = On"  bằng "display_errors = Off" .
- Cuối cùng lưu file lại và restart Apache Server.

6 nhận xét:

  1. Đây đâu phải là cách khắc phục đâu. Nó chỉ là ẩn đi cái thông báo lỗi :(

    Trả lờiXóa
  2. Đây đâu phải là cách khắc phục đâu. Nó chỉ là ẩn đi cái thông báo lỗi :(

    Trả lờiXóa
  3. Nhận xét này đã bị quản trị viên blog xóa.

    Trả lờiXóa
  4. Nhận xét này đã bị quản trị viên blog xóa.

    Trả lờiXóa
  5. Các bạn sửa bằng cách thêm public static function namefuction() của các bạn.

    Trả lờiXóa

Rất mong các ý kiến của các bạn khi đọc bài viết này !