Hello everyone, I haven’t been able to produce content for a long time and I haven’t had enough time here, frankly I couldn’t find enough time. At the first opportunity I found, I wanted to write a post or two. The first post is the kind of mistake that can happen to every user who uses wordpress.

One day you wanted to enter your website and you came across such a screen.

Your site was working fine and smoothly the last time you quit. So what happened now?

This error can have many causes. Code errors in the last plugin you added, a server-side change or the incompatibility of the plugins installed on your site after you have upgraded the wordpress version … This list goes on and on.

What is this “a critical error occurred on your website” problem?

This warning page, which is an error that can happen to every wordpress site owner, does not occur over a single problem. There may be many reasons for this. To solve this problem, when you enter your website, you cannot see any error codes. This is because wordpress takes security measures. First of all, we need to open the wpconfig.php file and activate the debug mode. After making the necessary arrangement, you can see the page that caused the error on our site and which code on that page caused this error.

After finding the error that makes our site unusable, we can take care of the necessary actions by connecting to the host where our website is hosted.

implementation steps for Solution

Editing the wp config file

Let’s connect to our server with ftp using the Filezilla program to access the wpconfig.php file that contains the settings of our wordpress site in the public html folder, that is, in the main folder of our site, and download the wpconfig.php file to our computer to activate the debug mode.

Before starting the process, it would be in your best interest to keep the original backup of the downloaded file and keep it aside for restoration if you make a mistake.

Let’s open the wpconfig.php file we downloaded and “define (‘WP_DEBUG’, false);” Let’s find the line. After finding this line, let’s replace the part that says “false” with “true” and save the file. After saving, let’s send the wpconfig.php file back to our server via ftp.

When we send the file back, the ftp application will ask us what to do because this file already exists on our server. Use the overwrite option.

Correction of the error

When we open our site again after the file editing and submission processes are over, it will show us where the error is. I am leaving a picture below for an example.

kenanyaman.com-web-sitenizde-kritik-bir-hata-olustu-2
kenanyaman.com-web-sitenizde-kritik-bir-hata-olustu

After turning on the debug mode, we can clearly see the error and error code given by our site. The reason for the error I encountered was due to insufficient memory space for the plugin called wpforms, so I had to increase the memory space that wordpress had to use. After learning the reason for this error, I learned what I had to do with a short google search and did not apply. In this section, you may have encountered such an error on your site due to a different error code or a different event. For this, you can find the necessary solution by searching the error or error code you encountered on google.

The solution I applied for this error was to find the “WP_MEMORY_LIMIT” part on wpconfig.php and duplicate the memory reserved for wordpress.

For the wp debug mode, we find the “WP_MEMORY_LIMIT” part as we did in the wpconfig.php file and change it and resubmit it using ftp to the host where our site is hosted.

Result

When I returned to my site after making this change for the error I encountered, I saw that the error had been fixed. After fixing the error, we do not leave the operations we did like this. We need to turn off the wp debug mode as we turned it on. It is important for security that we do not show these error codes to users who visit our site if a problem occurs on our site with an error like this.

If we go back to the beginning, we edit the WP_DEBUG part to be “false” again through the wpconfig.php file and send it to our server and finish the process.


Leave a Reply

Social profiles