Trusted WordPress tutorials, when you need them most.
Beginner’s Guide to WordPress
WPB Kupası
25 Million+
Websites using our plugins
16+
Years of WordPress experience
3000+
WordPress tutorials
by experts

WordPress’te PHP Hataları Nasıl Kapatılır

Editoryal Not: WPBeginner üzerindeki ortak bağlantılardan komisyon kazanıyoruz. Komisyonlar, editörlerimizin görüşlerini veya değerlendirmelerini etkilemez. Editoryal Süreç hakkında daha fazla bilgi edinin.

Geçenlerde bir okuyucumuz WordPress’te PHP hatalarının nasıl kapatılacağını sordu.

PHP uyarıları ve bildirimleri, geliştiricilerin kodlarındaki sorunları ayıklamalarına yardımcı olur. Ancak, tüm web sitesi ziyaretçileriniz tarafından görülebildiklerinde son derece profesyonelce görünmezler.

Bu makalede, WordPress’te PHP hatalarını nasıl kolayca kapatabileceğinizi göstereceğiz.

How to turn off PHP errors in WordPress

WordPress’te PHP Hatalarını Neden ve Ne Zaman Kapatmalısınız?

WordPress sitenizde görebileceğiniz PHP hataları genellikle uyarılar ve bildirimlerdir. Bunlar, web sitenizin yüklenmesini durduran dahili sunucu hatası, sözdizimi hataları veya ölümcül hatalar gibi değildir.

Bildirimler ve uyarılar, WordPress’in web sitenizi yüklemesini durdurmayan hata türleridir. Daha fazla ayrıntı için WordPress’in perde arkasında nasıl çalıştığına bakın.

PHP errors in WordPress admin area

Bu hataların amacı, geliştiricilerin kodlarındaki sorunları ayıklamalarına yardımcı olmaktır. Eklenti ve tema geliştiricileri uyumluluk ve en iyi uygulamaları kontrol etmek için bu bilgilere ihtiyaç duyar.

Ancak, özel bir tema, eklenti veya web sitesi geliştirmiyorsanız, bu hatalar gizlenmelidir. Çünkü web sitenizin ön ucunda tüm ziyaretçilerinize görünürlerse, son derece profesyonelce görünmezler.

WordPress warning errors on homepage

WordPress sitenizde yukarıdaki gibi bir hata görürseniz, ilgili tema veya eklenti geliştiricisini bilgilendirmek isteyebilirsiniz. Hatayı ortadan kaldıracak bir düzeltme yayınlayabilirler. Bu arada, bu hataları da kapatabilirsiniz.

WordPress’te PHP hatalarını, bildirimlerini ve uyarılarını nasıl kolayca kapatabileceğimize bir göz atalım.

WordPress’te PHP Hatalarını Kapatma

Bu kısım için wp-config.php dosyasını düzenlemeniz gerekecektir.

wp-config.php dosyanızın içinde aşağıdaki satırı arayın:

define('WP_DEBUG', true);

Bu satırın zaten false olarak ayarlanmış olması da mümkündür. Bu durumda, aşağıdaki kodu göreceksiniz:

define('WP_DEBUG', false);

Her iki durumda da, bu satırı aşağıdaki kodla değiştirmeniz gerekir:

ini_set('display_errors','Off');
ini_set('error_reporting', E_ALL );
define('WP_DEBUG', false);
define('WP_DEBUG_DISPLAY', false);

Değişikliklerinizi kaydetmeyi ve wp-config.php dosyanızı sunucuya geri yüklemeyi unutmayın.

Artık web sitenizi ziyaret ederek PHP hatalarının, bildirimlerinin ve uyarılarının web sitenizden kaybolduğunu doğrulayabilirsiniz.

WordPress’te PHP Hatalarını Açma

Yerel sunucuda veya hazırlık alanında bir web sitesi üzerinde çalışıyorsanız, hata raporlamayı açmak isteyebilirsiniz. Bu durumda, wp-config.php dosyanızı düzenlemeniz ve daha önce eklediğiniz kodu aşağıdaki kodla değiştirmeniz gerekir:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);

Bu kod, WordPress’in PHP hatalarını, uyarılarını ve bildirimlerini yeniden görüntülemeye başlamasını sağlayacaktır.

Umarız bu makale WordPress’te PHP hatalarını nasıl kapatacağınızı öğrenmenize yardımcı olmuştur. Ayrıca en yaygın WordPress hataları ve bunların nasıl düzeltileceğine dair listemizi ya da en iyi web tasarım yazılımı uzman seçimlerimizi görmek isteyebilirsiniz.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Açıklama: İçeriğimiz okuyucu desteklidir. Bu, bazı bağlantılarımıza tıklarsanız komisyon kazanabileceğimiz anlamına gelir. WPBeginner'ın nasıl finanse edildiğini, neden önemli olduğunu ve nasıl destek olabileceğinizi görün. İşte editoryal sürecimiz.

Avatar

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi with over 16 years of experience in WordPress, Web Hosting, eCommerce, SEO, and Marketing. Started in 2009, WPBeginner is now the largest free WordPress resource site in the industry and is often referred to as the Wikipedia for WordPress.

Ultimate WordPress Araç Kiti

Araç setimize ÜCRETSİZ erişim sağlayın - her profesyonelin sahip olması gereken WordPress ile ilgili ürün ve kaynaklardan oluşan bir koleksiyon!

Reader Interactions

41 yorumBir Cevap Bırakın

  1. Syed Balkhi says

    Hey WPBeginner readers,
    Did you know you can win exciting prizes by commenting on WPBeginner?
    Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
    You can get more details about the contest from here.
    Start sharing your thoughts below to stand a chance to win!

  2. A Owadud Bhuiyan says

    If I keep the debug true, but false the debug display. Will the error show on website?

    define(‘WP_DEBUG’, true);
    define(‘WP_DEBUG_DISPLAY’, false);

    • WPBeginner Support says

      The debug display being false would mean that the errors would not be visible on the front-end of your site.

      Yönetici

  3. Janet says

    Thank you so much! This fixed my problem in 30 seconds that I have been waiting for my hosting to fix for over 12 hours.

    • WPBeginner Support says

      Glad our guide could help. As a reminder, this hides the error from your site but you would want to try to resolve the root cause of the error you were seeing.

      Yönetici

  4. Karan says

    I have already done false in all . But in healthsite status always show WP debugging mode is enabled. please suggest me something

    • WPBeginner Support says

      You likely have it set to true in another section of the code, you likely want to reach out to your hosting provider for them to take a look and assist you.

      Yönetici

    • WPBeginner Support says

      You may want to check with your hosting provider to see if they have a log set up from their end

      Yönetici

  5. Rebecca P says

    I’ve been advised to turn these notices off and was directed to this article to help me with that. However, I do not have the ‘wp_debug’ line in my config file. Do I just add it in? And if so whereabouts in the file?
    Thanks!

    • WPBeginner Support says

      You may want to ensure you did not miss it in your current file but, you would place the code at the bottom of the file :)

      Yönetici

  6. Gary Guss says

    Clueless newbie! I’ve changed the wp-config.php file and saved it .. Do I have to upload this file to the server to get it to work? How do I do that Using Cpanel File manager.. Not seeing any debug suppression so I guess its somehow not picking up the edited file.. Halp Halp!

    Thanks,

    GG

    • WPBeginner Support says

      If you’re using the file manager your host offers, and directly edited and saved through that without downloading the file then the changes should be active on your site and you would want to check with your host for why the changes may not be getting applied to the file.

      Yönetici

  7. genfoch01 says

    ok so i know this is old, but i’m stumped. i am still getting php errors.

    Fatal error: Uncaught Error: Call to undefined function get_header() in /path/to/wordpress/wp-content/themes/mytheme/index.php:5 Stack trace: #0 {main} thrown in /path/to/wordpress/wp-content/themes/mytheme/index.php on line 5

    note that this issue was caught by a pen test and i was asked to suppress the error to avoid full paths being reveled. Any ideas would be helpful

    • WPBeginner Support says

      That is a fatal error for why it is still being displayed, you would want to either change themes or let your theme’s support know about the error to let you know how to fix it.

      Yönetici

  8. Abdulrahman says

    I faced the same problem after upating woocommerce plugin and the I used your method

    all erroers disappeared, however, I cannot log into the dashboard where it wp-admin shows a blank page

    is there any solution for that

    Thank you

Bir Cevap Bırakın

Yorum bırakmayı seçtiğiniz için teşekkür ederiz. Lütfen tüm yorumların yorum poli̇ti̇kasi uyarınca denetlendiğini ve e-posta adresinizin yayımlanmayacağını unutmayın. Ad alanında anahtar kelime KULLANMAYIN. Kişisel ve anlamlı bir sohbet edelim.