Free WP topic: hematemesis sorting: how to solve the fatal error of WordPress step by step, wordpress tutorial rookie tutorial 80 port error report

One year ago (2023-11-25) Chief Editor
12 minutes
three hundred and eighty
zero

The biggest headache for WordPress users is The site white screen cannot be opened Or The backstage can't get in This is the fatal error of WordPress. The English name is White Screen of Death, or WSoD for short.

Similarly, users who use the WPJAM Basic plug-in ask the most questions: Why is the xxx theme unavailable and the xxx plug-in unavailable after starting WPJAM Basic?

In fact, these are all due to compatibility problems, resulting in the fatal error of WordPress. My general advice is Disable other plug-ins, use the default theme, see if there are any problems, and then eliminate them one by one

Next, we will explain in detail what is a fatal error in WordPress, and how to locate and solve it step by step.

What is a WordPress fatal error

Even though the website has no problem with normal access, it is suddenly blocked into a blank screen. It may also get different error messages because of different browsers, such as the HTTP 500 error displayed in Chrome browser:

If Firefox browser, the screen will be blank, without any useful information:

If WordPress has enabled fatal error handling, the following information will be displayed:

The fatal errors of WordPress are caused by PHP code errors or memory restrictions. Generally, they are caused by some wrong themes or plug-in codes. For example, plug-ins and themes use the same functions, causing conflicts.

Therefore, most of the problems of WPJAM Basic plug-ins are caused by the conflict between other plug-ins or themes using the same functions or class libraries as WPJAM Basic.

So how to solve these problems?

Only this site or all sites?

If the server installs multiple WordPress, check whether other sites have problems. If the same problem occurs, it may be that the server has problems. Contact the service provider to see if there is a problem with the line or the server.

This is also why I always recommend using servers like Alibaba Cloud and Tencent Cloud, because such problems usually do not occur inexplicably, and if they occur, they will also be repaired quickly.

If it is just the problem of the site, it may be that the code of the site has a problem, so we should go deep into the site.

Is PHP memory limited?

A white screen often appears because the execution of PHP scripts requires a large amount of memory, but the server's restrictions make PHP scripts unsatisfied, such as the following error code. This may be because the program has written an endless loop, or it really needs such a large amount of memory.

Fatal error : Allowed memory size of thirty-three million five hundred and fifty-four thousand four hundred and thirty-two bytes exhausted (tried to allocate two million three hundred and forty-eight thousand six hundred and seventeen bytes) in /www/xxx/wp-includes/plugin.php on line xxx

Let's try to increase the memory limit of PHP script to see if it can solve the problem. Add the following line in the wp-config.php file to change the limit to 256M:

define ( WP_MEMORY_LIMIT , 256M );

File permissions cause problems?

Another reason that may cause the blank screen may be the file permissions and owners. This process is a bit troublesome, if not very Familiarity, suggest finding a professional Help you deal with it.

Generally speaking, for WordPress, the file permission rules are:

The file should be set to 664 or 644 The folder should be set to 775 or 755 wp-config.php The file should be set to 660, 600, or 644

If you can use SSH to log in to your server, you can execute the following command in the WordPress root directory:

sudo find . - type f -exec chmod six hundred and sixty-four {} +
sudo find . - type d -exec chmod seven hundred and seventy-five {} +
sudo chmod six hundred and sixty wp- config .php

WordPress plugin conflicts?

If the problem cannot be solved, then the next way to solve the WordPress fatal error is to disable all plug-ins first. Generally speaking, a site hangs because of a faulty plug-in.

1. If you can still access the WordPress management background, the fastest way is to go to the background plug-in page, select all plug-ins, and select Disable in the batch operation drop-down menu.

If the problem can be solved after disabling all plug-ins, then we need to find out which plug-in is causing the problem. Generally, we find the problem by activating plug-ins one by one. Every time we activate a plug-in, refresh the problem interface. If the problem reappears, we can locate which plug-in is causing the problem.

2. If the background is no longer accessible, it can only be handled through FTP wp-content Catalog, and then plugins Folder changed to plguins-old catalog.

After changing the name, check whether the website can be accessed. If so, check plug-ins one by one. Change the plug-in directory back to " plugins Then, in the plug-in directory, rename each plug-in to locate the faulty plug-in.

Incompatible WordPress themes?

If the problem is not caused by plug-ins, it is likely to be caused by the theme, so many problems with WPJAM Basic are caused by themes, and many functions used by themes conflict with WPJAM Basic functions.

For example, I introduced some tool functions written by myself on my blog. These functions try to wpjam_ It started, but some topics have not been changed, and they are used directly. There are also some in the WPJAM Basic plug-in, so it is a conflict.

1. We can locate the problem by switching back to the default WordPress theme. If we can still access the background, go to "Appearance" - "Theme" and select a default WordPress theme, such as the latest 2021:

Then refresh the problem interface. If the problem reappears, it is the problem of the theme.

2. If you cannot access the background, the processing method is the same as that of the plug-in in the previous section. Use the FTP tool to access wp-content Directory, rename it themes folder.

In this way, WordPress will automatically use the latest default theme, such as 2021. Finally, if the problem reappears, it is the problem of the plug-in. If it is confirmed that it is, you can consider changing the topic.

Is there a problem with the cache of the browser and WordPress?

The browser cache and plug-in cache may also cause fatal errors. It is recommended to clean them first.

If you have installed a cache plug-in, such as WP Rocket or WP Super Cache, the fastest way to delete the cache is through the plug-in settings page.

For example, WP Super Cache, in the " set up 」-「 WP Super Cache 」-「 Delete Cache "To clear the cache.

If FTP cannot be accessed, the cached file will be wp-content/caches Directory, you can enter to delete.

Magnification: Open WordPress Debug mode

If we can't solve the problem, we will use the last big move to directly locate the wrong log. We ignore the previous method and directly use this to solve the problem.

For programmers, the most important thing is to know what the problem is, the details of the problem, and the specific error log. In this way, WordPress Debug mode should be enabled.

WordPress provides WP_DEBUG WP_DEBUG_DISPLAY and WP_DEBUG_LOG These three constants allow you to deal with various situations. The following methods are often used:

one If the foreground and background are blank, and no error is displayed

Open the wp-config.php file and change the original WP_Debug settings to the following settings:

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

In this way, you can directly see the error information:

Cannot redeclare get_posts () ( previously declared in
/ var /www/html/wordpress/wp-includes/post.php: one thousand eight hundred and seventy-four
) in
/ var /www/html/wordpress/wp-content/plugins/test-plugin/test-plugin.php on line 38

For example, the error message above is test-plugin The plug-in defines get_post Function, this function WP is built-in, and the function name conflicts.

two The error occurred in some background processes For example, when a cron job or WeChat custom reply fails to display the error log, we can save the log to the debug file.

Open the wp-config.php file and change the original WP_Debug settings to the following settings:

define( WP_DEBUG , true );
define( WP_DEBUG_DISPLAY , false );
define( WP_DEBUG_LOG , true );

Then you can wp-content/debug.log You can see the corresponding error message in the file.

Finally, we must remember that after the test, we must change it back, that is:

define( WP_DEBUG , false );

Otherwise, your users will also see your system error, or wp-content/debug.log great , use up all your server space.

Additional skill: enhance PHP text processing capability

If you have not solved your fatal error, and the error occurs on the article editing page, and the probability is very small because the article is too long.

If this is the case, we can try to increase backtracking and recursion restrictions to enhance PHP text processing capabilities wp-config.php Add the following code to the file:

/*Tips for long articles*/
ini_set ( pcre.recursion_limit , twenty million );
ini_set ( pcre.backtrack_limit , ten million );

Summary: patiently handle and provide logs

It is not terrible that a fatal error occurs in WordPress. You can always solve the problem step by step according to the method suggested in this article. So you are also welcome to collect this article to facilitate the handling of problems in the future.

Similarly, if you have problems using WPJAM Basic, don't panic, and don't say the problem directly without any details, so no one can help you. After all, programmers are human, not gods.

It is generally recommended that you solve the problem yourself first, but not finally. As long as you give the relevant error logs (pay special attention to the previous section on how to generate logs), we can help you locate the problem and then solve it.

If the host you use causes problems, it is recommended to switch to Alibaba Cloud and Tencent Cloud, or recommend using my link to earn me a little commission, so that I can have more incentive to write tutorials.

This article is written by: Chief Editor Published on Software Development of Little Turkey , please indicate the source for reprinting: //hongchengtech.cn/blog/528.html
Kuke_WP editor
author

Related recommendations

1 year ago (2024-02-20)

What technologies have been applied and developed in the field of new media, and the application of new technologies in media

In the field of new media, many technologies have been applied and developed. These include: cloud computing: cloud computing technology enables new media companies to develop and deploy applications more quickly, and can dynamically adjust resources according to needs. Big data: New media companies can use big data technology to analyze massive user data, understand user preferences, behavior habits and other information
nine hundred and seventy-one
one
1 year ago (2024-02-20)

WMS warehouse management system, promoting the transformation of warehousing from extensive to fine management, WMS warehouse management

Warehousing is extremely important for the manufacturing industry and is an important guarantee for the survival and development of manufacturing enterprises. However, with the expansion of manufacturing enterprises' business, the traditional warehouse management has been unable to respond to business changes quickly. The extensive management mode not only makes the warehouse operation not smooth, but also increases the storage cost. Therefore, it is necessary for manufacturing enterprises to deploy a WMS warehouse management system
eight hundred and forty-eight
one
1 year ago (2024-02-20)

How to select MES system? Main contents of MES production management

Original title: How to select MES system? The main content of MES production management Production and manufacturing activities are the core activities of manufacturing enterprises. As the entity unit of manufacturing activities, planning objectives and the realization of enterprise value, workshop management is the focus of enterprise management. With the rapid development of manufacturing industry, MES is the focus and current hot spot of manufacturing enterprise information automation system
nine hundred and sixty-four
zero
1 year ago (2024-02-20)

The WeChat management system can manage the information content of WeChat more effectively. Let's manage the data of WeChat here

Original title: WeChat management system manages the information content of WeChat more effectively. Many enterprises will assign work to WeChat, because no one wants their personal WeChat to mix work and other related knowledge, but someone will always use the company's loopholes to do something harmful to the company's interests. Don't think such things are rare. I learned about a media financing company in Shenzhen. They have 3
seven hundred and seventy-five
zero
1 year ago (2024-02-19)

Student electronic file management system, three-dimensional communication space of "home", "school" and "community", and school electronic files

In the era of big data, in the process of recording the growth of students, the school reexamines the management of student files, moves with the times, and promotes the reform of student growth files with new thinking. "Electronic files of primary and secondary school students' growth records" have been gradually introduced into educational management, and show vigorous vitality. Student file management system is an indispensable part of the school, its content for the school
five hundred and sixty-nine
zero
1 year ago (2024-02-19)

Ruizhe Information: Select Sitecore? Or... just six steps to choose a content management system, Ruizhe Information Technology Service Co., Ltd

The content management system (CMS) is an important part of the success of website construction. At present, the content management system on the network is relatively complex. It is not easy to find a good content management system that is very suitable for the current digital marketing environment. Before we compare the functionality, operation, scalability, security and other specific performance of the major CMS systems, we need to achieve
three hundred and forty-three
zero

comment

0 people have participated in the review

Scan code to add WeChat

contact us

WeChat: Kuzhuti
Online consultation: