Memperbaiki Error Deprecated preg_replace() pada PHP 5. Kemarin, coba-coba belajar Joomla lagi, dengan versi 2.5, menggunakan PHP 5.X pada aplikasi XAMPP for MacOSX. Saya baru mengalami error seperti ini,
Cari bantuan sana-sini, akhirnya ketemu solusi. Error tersebut ternyata karena pada PHP 5.X, sudah tidak menggunakan fungsi xxx, tetapi karena saya masih mau menggunakan Joomla 2.5, jadinya, harus di-fix-kan masalah ini.
Caranya gampang saja, cukup edit file PHP.INI, pada lokasi instalasi XAMPP Anda. Kemudian cari parameter
display_errors=On
ganti menjadidisplay_errors=Off
Lanjut, cari parameter
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
menjadierror_reporting = E_ALL & E_NOTICE | E_STRICT
Bingung tentang parameter tersebut?, di PHP.INI ada koq, berikut saya lampirkan
; 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
Tanda ~ berarti negasi (bukan), tanda & berarti dan, dan tanda | adalah tanda atau.
Begitulah kira-kira.
Akhirnya, error sudah tidak tampil lagi, Joomla pun siap digunakan..
Semoga bermanfaat
(z)
; 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
Tanda ~ berarti negasi (bukan), tanda & berarti dan, dan tanda | adalah tanda atau.
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
ini artinya, tampilkan semua error dan (tidak) termasuk error deprecated dan juga (tidak) termasuk error strict error_reporting = E_ALL & E_NOTICE | E_STRICT
nah, kalo ini berarti tampilkan semua error dan error notice (atau) error strict.Begitulah kira-kira.
Akhirnya, error sudah tidak tampil lagi, Joomla pun siap digunakan..
Semoga bermanfaat
(z)
No comments:
Post a Comment