how to resolv “Strict Standards: Non-static method JLoader::register() should not be called statically”

2 hari ini saya memindahkan salah satu server fakultas ke mesin yang baru, lengkap dengan semua virtual host yang ada dalam satu mesin tersebut. Setelah proses pemindahan dokument root dan databasenya selesai, mulai lah diaktifkan server yang baru unutk diakses. Pas coba diakses ke alamatnya, muncul error:

Strict Standards: Non-static method JLoader::register() should not be called statically in /usr/home/webroot/newfisip/​libraries/loader.php on line 71

Error tersebut disebabkan karena error reporting pada settingan PHP masih dihidupkan, jadi harus kita matikan dulu laporan tersebut. Ada banyak macam level laporan error untuk PHP.  Antara lain:

Error Level Constants:
E_ALL – All errors and warnings (includes E_STRICT as of PHP 6.0.0)
E_ERROR – fatal run-time errors
E_RECOVERABLE_ERROR – almost fatal run-time errors
E_WARNING – run-time warnings (non-fatal errors)
E_PARSE – compile-time parse errors
E_NOTICE – run-time notices (these are warnings which often result from a bug in your code, but it’s possible that it was intentional (e.g., using an uninitialized variable and relying on the fact it’s automatically initialized to an empty string)
E_STRICT – run-time notices, enable to have PHP suggest changes to your code which will ensure the best interoperability and forward compatibility of your code
E_CORE_ERROR – fatal errors that occur during PHP’s initial startup
E_CORE_WARNING – warnings (non-fatal errors) that occur during PHP’s initial startup
E_COMPILE_ERROR – fatal compile-time errors
E_COMPILE_WARNING – compile-time warnings (non-fatal errors)
E_USER_ERROR – user-generated error message
E_USER_WARNING – user-generated warning message
E_USER_NOTICE – user-generated notice message
E_DEPRECATED – warn about code that will not work in future versions of PHP
E_USER_DEPRECATED – user-generated deprecation warnings

Common Values:
E_ALL & ~E_NOTICE (Show all errors, except for notices and coding standards warnings.)
E_ALL & ~E_NOTICE | E_STRICT (Show all errors, except for notices)
E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors)
E_ALL | E_STRICT (Show all errors, warnings and notices including coding standards.)
Default Value: E_ALL & ~E_NOTICE
Development Value: E_ALL | E_STRICT
Production Value: E_ALL & ~E_DEPRECATED
(http://php.net/error-reporting)

langkah trouble shoot:

buka file php.ini (diserver saya ada pada directori /usr/local/etc/php.ini), kemudian cari baris program berikut:

Code:
error_reporting = E_ALL | E_STRICT

rubah menjadi:

Code:
error_reporting = E_ALL & ~E_STRICT

cari juga:

Code:
display_errors = On

rubah menjadi:

Code:
display_errors = Off

exit dan save file php.ini, kemudian restart apache dengan perintah:

# /usr/local/etc/rc.d/apache22 restart
Performing sanity check on apache22 configuration:
Syntax OK
Stopping apache22.
Waiting for PIDS: 48641.
Performing sanity check on apache22 configuration:
Syntax OK
Starting apache22.

Kemudian, cek web anda.

Selesai.

Warning!

Pastikan error_reporting dan display_errors sudah anda rubah pada file php.ini, karena kalau tidak akan tertimpa dengan settingan default. Selanjutnya, Anda dapat meninggalkan var $ error_reporting = ‘-1’; tidak berubah pada joomla configuration.php

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s