Menampilkan PHP errors dari website dan mengaktifkan PHP error display dari pesan error 500 Show
Ditulis oleh Shinta Theofani Ikuti panduan di bawah ini untuk menampilkan notifikasi error melalui hPanel dan WordPress. Bagaimana cara mengaktifkan PHP error display dan login di hPanel?Di hPanel, Anda dapat memilih untuk langsung menampilkan PHP error di website atau menyimpannya di log file. Caranya, login ke control panel, kemudian Hosting → Kelola → Konfigurasi PHP: Setelah itu pilih Opsi PHP, dan beri centang pada salah satu opsi tampilan PHP error yang diinginkan.
Setelah itu, klik Simpan 😊 CATATAN:
Bagaimana cara mengaktifkan error display di WordPress?Jika Anda menggunakan WordPress, buka File Manager dan temukan file public_html/wp-config.php. Periksa file tersebut memiliki baris seperti ini:
Kemudian, ubah "false" menjadi "true", dan tambahkan baris ini:
Bagaimana cara mengaktifkan error display melalui .htaccess?Agar dapat melakukan logging PHP error di file error_log, tambahkan baris di bawah ini di file .htaccess:
PENTING: Pastikan untuk membuat backup dari file .htaccess terdahulu sebelum menerapkan beberapa perubahan. Pengaturan yang salah dapat menyebabkan website Anda tidak dapat diakses. CATATAN:
Article guide you to PHP enable warnings and PHP disable warnings/errors. Whereas it can possible with htaccess display_error off (error reporting off) method. Table of Contents Enabling PHP warnings via .htaccess file is useful when you initially developing and debugging your websites. But once website development is completed you should turn off PHP warnings. But, why to disable PHP warning in htaccess?Untrusted sources can see detailed web application environment error messages. In which having sensitive information that can be used for attack. Error messages can reveal information about your website, such as path information and variables. That can be used by attacker to hack your website or web application. So you can check here and secure site by migrating HTTP to HTTPS. Let’s see how to secure your important information by turning off PHP warning. How to turn off PHP warning messages?It is highly recommended to turn off PHP warnings in htaccess in order to avoid leakage of important information. You can disable PHP warnings using display_errors from your .htaccess file. Steps you need to follow to remove PHP warnings with .htaccess1] Login into your cPanel account. 2] Select File Manager in File Section. 3] Click on the settings. 4] Enable check box “Show hidden files”. 5] Select .htaccess file and click on Edit option. 6] Add single a line in .htaccess file and click on Save Changes. Code: php_flag display_errors offWe should disable PHP warning in .htaccess because,
In this way you can turn off warning messages in PHP using .htaccess file cPanel and can protect your website from Hacker. If you have any doubts or any problems then please let us know through your comment, we will defineatly try to solve your problems. For additional information you can click here and learn how to secure your website from hacker. Reader InteractionsHow do I turn off PHP warnings?Remember, the PHP ini configuration has an error_reporting directive that will be set by this function during runtime. error_reporting(0); To remove all errors, warnings, parse messages, and notices, the parameter that should be passed to the error_reporting function is zero. How do I hide PHP warnings and notices in WordPress?Either way, you're looking for the “WP_DEBUG” portion of the wp-config. php file. Click the “Save Changes” button in the top right. Once the file is saved, this will disable the PHP warnings in WordPress. Where are PHP error logs cPanel?cPanel Error Log Login into your cPanel. Go to Metrics > Errors. Your error log will display in the box. |