Cấu hình notices, warnings và errors trong Drupal Site

Cấu hình notices, warnings và errors trong Drupal Site

Websites will run into problems. Whether you're using Drupal or any other software, there will be problems at some point.

Drupal runs on PHP and when PHP has problems, it reports them to you. However, often these errors will appear on your site and will be visible to visitors:

Cấu hình notices, warnings và errors trong Drupal Site

In this tutorial, we're going to give you a quick introduction to these errors. We'll explain the different types that might appear on your site and how you can stop them from showing.

Notices vs Warnings vs Errors

There are three main ways in which PHP will report problems: notices, warnings and errors.

Notices

These are the least important. According to the official PHP website, notices are generated when:

"the script encountered something that could indicate an error, but could also happen in the normal course of running a script."

Warnings

Warnings are more serious, but probably won't break your site. According to the official PHP website, warnings are:

"non-fatal errors. Execution of the script is not halted."

Errors

Errors are the most serious type of problem and may break your site. According to the official PHP website, warnings are:

"Fatal run-time errors. These indicate errors that can not be recovered from, such as a memory allocation problem. Execution of the script is halted."

Option 1: Disabling Error Reporing on Your Drupal Site

One the solution, and probably the one you'll take first, is to stop the errors from showing.

  • Go to Configuration > Logging and Errors.
  • You have three choices:
    • None will disable all error reporting.
    • Errors and warnings will display on the most serious problems.
    • All messages will display all problems and is probably only useful for developers.
tutuploadsmedia_1350417904398.png

Option 2: Fix the Problem

Yes, yes, I know this is a controversial idea. Fixing a problem is definitely harder than hiding a problem.

Here are some suggestions to help you fix the problem. Please backup your site before trying any of these.

  • Make sure your Drupal site and all your modules and themes are up-to-date.
  • Search Google and Drupal.org for anyone who has reported the same message. See if they have found a solution.
  • Read the message itself for hints about the problem. For example, the problem in the image at the top of this tutorial is all/modules/calendar/includes/calendar_plugin_display_page.inc on line 47. This tells that the problem may well be with the Calendar module, because the error is coming from the Calendar module folder. If the problem is serious, you might consider disabling the problematic module or theme.
Bạn thấy bài viết này như thế nào?: 
No votes yet
Ảnh của Khanh Hoang

Khanh Hoang - Kenn

Kenn is a user experience designer and front end developer who enjoys creating beautiful and usable web and mobile experiences.

Tìm kiếm bất động sản

 

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
Vaccine ComBe Five.

Chọn vaccine "5 trong 1" ComBe Five của Ấn Độ thay thế cho Quinvaxem lợi hay hại.

Bắt đầu từ tháng 6-2018, Việt Nam sẽ sử dụng vaccine ComBe Five của Ấn Độ để thay thế vaccine “5 trong 1” Quinvaxem của Hàn Quốc trong chương trình tiêm chủng mở rộng (TCMR) quốc gia, tiêm miễn phí cho trẻ dưới 1 tuổi.

Window, Window 7, Mac iOS 6, Mac OS, MacBook Air, MacBook Pro

Hướng dẫn thiết lập mạng riêng ảo (VPN) của riêng bạn trên Windows và Mac

Mạng riêng ảo (hay Virtual Private Network) là một mạng thường dành riêng để kết nối các máy tính trong nhà hay trong một tổ chức với nhau thông qua Internet

Biến Profile Facebook thành bức ảnh ghép độc đáo!

Biến Profile Facebook thành bức ảnh ghép độc đáo!

Mời bạn xem thêm bài viết liên quan: 30 giây cho một trang Profile độc đáo - đã xuất hiện những công cụ hỗ trợ làm nên trang profile thành bức ảnh ghép độc đáo như trên!

Công ty diệt chuột T&C

 

Diet con trung