How to fix an internal server error. Internal Server Error


We have released a new book “Content Marketing in in social networks: How to get into your subscribers’ heads and make them fall in love with your brand.”

Subscribe

Internal Server Error is a status class HTTP protocol, which means that the user's operation/request was unsuccessful and the server itself is to blame.


More videos on our channel - learn internet marketing with SEMANTICA

You've run out of food. You need to go to the grocery store. There is a sign on the door - “Accounting”. You are without food.

The user wants to visit the site. A request is sent to the server. And if there are any problems on the server, then the person will see an error message in the browser window.

What are the server errors?

As we've learned, internal server errors constitute a class of HTTP statuses.

  • . Indicates a wide range of server errors, if they do not belong to the following problems of the class in question.
  • 501. Means that the server does not have the necessary capabilities to process the user request. Typically, a 501 error appears when the server cannot recognize the request method. If the server recognizes the request method, but it cannot be used on this Internet the resource displays error 405 (it was due to the user’s fault).
  • . Occurs when the server acts as a proxy or gateway. The error indicates that the upstream server is sending an invalid response.
  • . Displayed when the site is unable to process user requests. This may be due to overload, maintenance problems, technical problems, and so on. Most often, when a 503 error is displayed, the Retry-After field indicates the time when the user needs to repeat the request.
  • 504. Here again the server acts as a gateway or proxy server. It forwards the request to the upstream server, but does not wait for a response, and therefore cannot complete processing of the request.
  • 505. Indicates that the request version is not supported by the server.
  • 506. This means that the current version of the server has an incorrect configuration. In this regard, the binding process does not reach completion and is interrupted all the time.
  • 507. There is no space on the server to complete the request and process it. Problems of this kind may be temporary and easily fixed.
  • 509. If an Internet resource has spent all the traffic that was allocated to it, a this error. To resolve the problem, you need to contact your hosting provider.
  • 510. This error can be encountered in cases where the client makes a request and wants to use a certain extension, but the server does not use and cannot provide this extension.
  • 511. This error does not come from the server itself, which the user is accessing, but from an intermediary, which can be a provider. Typically, the problem occurs when the client needs to log in to global network(specify the password for toll point access). In this case, a special field for authorization is displayed in the response form.
  • 520. Indicates that there is an error, but the CDN server cannot correctly process the error and display it to the client.
  • 521. Occurs in situations where the server rejects the content delivery network connection.
  • 522. Displayed when the data communication system cannot connect to the server and is timed out waiting for a server response.
  • 523. The server cannot be “reached”; when accessing the server, serious obstacles arise, overcoming which is difficult. this moment is not possible.
  • 524. Connection timed out required server and a content delivery network server.
  • 525 If errors occur during the handshake between the server itself and the CDN server, code 525 is displayed.
  • 526. Indicates that there is currently no way to validate the encryption certificate.

What to do if they write “Server error”

The listed errors usually arise due to the .htaccess file, themes and plugins. Let's consider options for solving the problem.

So you liked it new topic design and you installed it. Everything would be fine, but then an internal server problem arises. To restore the server's functionality, select one of the following methods:

Via FTP

We go into it and look for a folder with themes. Open the folder and correct/delete the theme that is currently posted on the site. We go to the site and see a blank page without errors.

Open the administrator WordPress panel, then the design theme, we receive a notification about the activation of another theme. A little advice: do not delete standard themes, they serve as a standard and can be activated after the site is restored.

Via PhpMyAdmin

If you have deleted/edited standard theme, you need to download and install it again. This can be done from the following resources: TwentyTen, TwentyEleven, TwentyTwelve. After downloading, open PhpMyAdmin, then the database.

Go to the SQL tab and copy the code below into it.

Please note that the topic name must be specified correctly. Then the site will work as usual.

If the problem is with plugins, the server does not work correctly and the site is displayed differently. At the same time, access to the console is preserved, which allows you to disable this or that plugin. Sometimes an installed plugin may conflict with other plugins that are already installed and activated on the resource. Then it crashes and displays Internal error. You can disable the plugin in 3 steps:

  1. Open the FTP resource.
  2. Open the folder with existing plugins.
  3. Delete/change the name/edit the plugin.

If the errors are problems with the .htaccess file, you need to do the following:

1. Open FileZilla, “Server” menu and check the box next to “Display hidden files forcibly." We update the list of files and find our .htaccess file.

2. Open the file through notepad/text editor. A text is displayed in front of you - a list of instructions and rules for the functioning of the web server. Review the file and correct any errors. Alternative option- delete the file completely and then write with using WordPress new file(open the admin panel, then “Options”, then “Permalinks”. Select the right option, click "Save").

If the above measures do not give the desired result, you must contact a qualified programmer.

As you can see, the list of errors is quite wide. If identified, they must be eliminated as early as possible.

In the article I will describe what this 500 Internal error is. Server Error and how to fix it. After I encountered it, I realized that this is an internal server error, which can appear due to a number of problems on the site. The window that appears can be different in shape and description, it depends on the server, but the essence remains the same for everyone. If you encounter error 500, try logging in after a while, maybe the problem has already been resolved. If the problem persists long time, which means you need to act yourself.

What is this 500 Internal Server Error problem in WordPress?

This error is not a failure in the CMS, but a 500 Internal Server Error usually appears when scripts are not working correctly on the server. Usually, the error text does not tell us anything specific, we only know that problems are occurring on the server side. It is clear that this error can occur in WordPress due to a template or plugin function.

Checking the integrity of the .htaccess file in WordPress

To perform the check, you need to rename the .htaccess file, for example, to .htaccess_fix. To do this, you will need to log into your site with using FTP. After that, find this file in the root of the site, it will be near the wp-admin, wp-content directories.

Once you have completed the rename, try loading the site again to make sure the error goes away. Now make sure that you save the changes in the “Permanent Links” item, this will generate a new .htaccess file with the correct rules for rewriting links.


File.htaccess

Increase PHP memory

Error 500 Internal Server Error may occur due to memory full PHP that is allocated to the user. To do this, follow these simple steps:

  1. Create a new test document called php.ini.
  2. Write the code in it - memory=64MB.
  3. Save it.
  4. “Upload” it to the /wp-admin/ folder, via FTP.

The problem with 500 Internal Server Error lies in WordPress plugins

If the methods described above did not help you, it is likely that the cause of the 500 Internal Server Error is one of installed plugins. To verify this, you will have to disable them all. If the problem is solved in this way, then one of the plugins is to blame, and which one will need to be installed, turning them on one by one.


Window with plugin settings

Error 500 Internal Server Error appears when logging into Joomla admin panel

Users receive this error CMS Joomla can be observed after they have entered their username and password when logging in, but the site still works for users. Unfortunately, Internal Server Error code 500 does not indicate the reasons for its occurrence, so you will have to look for it yourself.

You can find the cause using the error log, which is stored on the server. By opening the file “error.php”, which is located in the “logs” directory, you can detect violations in the operation of the modules that are stored here.

Another reason could be the inability to write to the "tmp" and "logs" directories. You may need to set permissions in the settings for these directories. Check that the paths to these “tmp” and “logs” directories are correct in the file that is responsible for their configuration – “configuration.php”. It is recommended to specify right paths for them manually.

If the problem persists, check the correctness of the “htaccess” file and perform the same actions for it as with a similar file for the WordPress content management system. This file may contain typos or unnecessary information that causes an error. When working with the htaccess file, you can not delete questionable lines, but comment them out and check whether the site’s operation changes after this. Also disable all plugins to make sure that they are not the cause.

Other causes of 500 Internal Server Error


Error Internal Server Error

Error 500 may appear due to conflicts when working with CGI scripts. There are 3 rules for this that may not be followed:

  • Each line must end in UNIX (n), but not Windows (rn) format. To comply with this rule, it is necessary to download according to FTP protocol, with ASCll mode.
  • While a CGI script is running, HTTP headers with incorrect responses may appear. Contents need to be reviewed system file"error log" to check for errors.
  • Digital value for CGI scripts, files and folders must be set to 0755. This entry gives the right to make settings exclusively to the site owner, which is additional measure security.

Reason for error 500 – access rights are incorrectly configured

Using an FTP client (FileZilla is suitable for this), you need to check access rights to folders and files on the server. First you need to check if the settings match correct operation on server. Check the settings for each type separately. They must correspond to the following values:

In order to avoid various errors(500 Internal Server Error) and provide additional security– global settings must be managed by one person – the administrator. Do not give anyone access rights to the root folders.

Page with response code 500 The web server returns when it cannot process the request due to errors in the site files.

The appearance of the 500 error depends on what is causing it. If there are problems with the site scripts, a blank page, HTTP ERROR 500 message, or PHP handler text will be displayed.

If the problem is in the .htaccess file, the message is Internal Server Error.

Often the 500 error can be easily resolved even without knowledge of web development. We'll tell you how to do this later.

Errors in the .htaccess file

The message is displayed when there are errors in the .htaccess file. Rename the .htaccess file and check that the site is working correctly. If available, remove the most recently added rules, or old file from a backup.

Errors in site scripts

A blank page is not always a sign of a 500 error. Therefore, first of all, find out the response code with which it opens. This can be done using developer tools in browsers.

Function for studying the operation of the site. It allows you to find out the server response time, response code, see the text of any errors that occurred, and much more.

Press the keyboard shortcut Ctrl+Shift+I or use the browser menu:

  • Mozilla Firefox - “Web Development” → “Developer Tools”;
  • Google Chrome - “Additional tools” → “Developer tools”;
  • Opera - “Development” → “Developer Tools”.

Go to the tab "Network". Error 500 is indicated by the corresponding number in the column "Status".

Status blank page maybe 200 (Ok). In this case, check if the content is in the site's index file, clear the cache of your CMS. If the site previously worked correctly, it is from a backup copy.

Displaying errors on the site

Conclusion PHP errors On hosting it is disabled by default. To see their text, add to the .htaccess file: php_value display_errors 1 and refresh the site page.

If the text is not displayed, enable error output through the CMS configuration file. It is located in the site.

In the wp-config.php file, replace the line define('WP_DEBUG', false); to define('WP_DEBUG', true);

Change the value of the debug and error_reporting variables in configuration.php to: public $debug = "1"; and public $error_reporting = "maximum";

IN configuration file along the path ~/public_html/bitrix/php_interface/dbconn.php replace the value of the DBDebug and DBDebugToFile variables with: $DBDebug = true; and $DBDebugToFile = true;

In the .env file change APP_DEBUG=false to APP_DEBUG=true

An algorithm for eliminating the error can be found on the Internet by placing its text in any line search engine. If using the information found it is not possible to resume the site, use it from a backup copy. Our specialists can help with recovery. To do this, send a request from the “Support” section of the Control Panel.

Sometimes the error is not displayed on the page or occurs periodically: it is difficult to track down. To find out the text of such errors, write information about them to a file - the PHP error log. it by adding the line to .htaccess: php_value error_log /home/username/domains/domain.ru/php_errors.log and refresh the site page.

Open the created log file using the File Manager in the Control Panel. To view errors that occur in real time, check the “Enable auto-update” option.

You can quickly resume the site from a backup copy for a date when there were no errors. If restoration is not desired, contact the developer.

Some errors do not require special knowledge to resolve. Let's look at the most common ones.

Lack of RAM

Error with text Allowed memory size arises due to a lack random access memory to execute the script: PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 81 bytes) in /home/username/domains/domain.ru/public_html/somescript.php

To fix it, limit the RAM by adding the directive to the .htaccess file:

Php_value memory_limit 512M

Instead of "512" enter the required amount of memory. Maximum value limited by tariff.

Text Out of memory means that the RAM limit has been reached tariff plan:

PHP Fatal error: Out of memory (allocated 39059456) (tried to allocate 262144 bytes) in /home/username/domains/domain.ru/public_html/somescript.php

Optimize your scripts so they consume less memory. Perform bulk loading or unloading of data in parts. If optimization is not possible, change the tariff to one that provides enough memory for comfortable work site.

Errors in CMS

When updating the CMS, syntax errors occur:

PHP Parse error: syntax error, unexpected "[", expecting ")" in /home/username/domains/domain.ru/public_html/wp-content/plugins/wordpress-23-related-posts-plugin/config.php on line 130

This happens because the new CMS features do not support outdated versions PHP. To fix the error, change the PHP version for the site to a more modern one in the “Sites and Domains” → “Site Management” section.

If the previous recommendation did not help, pay attention to the path to the broken script: the plugin or theme directory may be indicated there. To fix the error, disable them. To do this, rename the folder in which they are located. After fixing the error, log in to the administrative part of the site and change the theme or reinstall the plugin.

To fix most PHP errors, it is enough to study their text and take the measures indicated in the article. If you are unable to resolve it yourself, please contact support.

One of the most popular platforms today is Worpress. It has a convenient administrative console and with it, almost any user can now independently create their own website. But sometimes surprises happen that completely paralyze the work of the site and confuse you. And then a terrible thing appears before my eyes White screen death, an unknown PHP error caused by server problems, or scheduled plugin updates that led to the crash of the site. Any problem can be solved with enough knowledge and invaluable experience. And this time we will talk about the internal server error (Internal Server Error), as well as its causes and remedies.

Error 500 or Internal Server Error

Everyone who has their own website on WordPress based, he has struggled with this error at least once and knows about it firsthand. The main trick is that when it occurs, there is initially no understanding of the specific cause, and, accordingly, necessary ways solutions. A number of these very reasons are quite diverse, but they are completely solvable.

Problems that cause Error 500:

Conflicts in plugins (usually occur after an update)
Problems with the site theme (occurs when updating the parent theme)
Errors in the .htaccess file
PHP memory limit exceeded

How to resolve Error 500.

For many, especially beginners, this attack can be very frightening and a real dead end, but there is no need to worry. Access to the site via the console has been disrupted, but the server can be accessed using special software. Therefore, there is no need to panic.

Correction of the .htaccess file.

The main and most common cause This problem is precisely the incorrect operation htaccess file. To fix this glitch you need to log in to root directory WordPress, a special one is suitable for this file manager(or ). Then rename it to .htaccess.back. Then simply refresh the window and check if this measure helped. If everything is fine, then you need to go to the “Options” -> “Permanent Links” section and click on “Save Changes” so that the new .htacess file will restart and overwrite the rules. If it doesn’t help, then move on to plugins.

Deactivate all plugins

As a rule, the problem occurs when, and then everything is extremely simple - you simply need to disable it or delete it. But if the problem happened due to an old plugin that was installed before and as a result of the update led to a failure, then you will have to think about it and try to disable them one by one. This is the most effective way to determine the source of the problem. Sometimes this happens because plugins begin to conflict with each other and only disabling them one by one will give you an understanding of who the culprit is.

Note: the presence of Error 500 blocks access to the site's administrative panel. In this case, extensions are removed or disabled without access to the panel; the main thing is to follow the instructions correctly. After deactivating the culprit, delete it and download an alternative from the app store. You can notify the creator of the extension about the error, which will help improve the existing software and protect other users from the prospect of having to deal with the same problems.

If this solution does not help, then we will have to change the topic.

Changing Theme

If, after all, the plugins have nothing to do with surprises, then perhaps it’s all about the theme. site to any standard one and restart it. If it doesn’t help, you’ll have to work with the WordPress directories.

Restoring the “wp-admin” and “wp-includes” directories.

If the failure is still present, you can replace it specified folders fresh copies from latest version WordPress.

Increasing PHP memory limit.

When the above does not help, then do not despair. You will have to seriously work to get everything in order on your server. Error 500 is solvable and is not the end of your site. If circumstances force you to use extreme measures, then using the Code Editor you need to write text file by renaming it to php.ini.
Inside it you need to write: memory=64MB
Upload the saved file to the “wp-admin” folder. In case of eliminating the failure and expanding the PHP memory, you need to find out from your phone what exactly could lead to the over-limit. The hoster has all the entries from the operation log, and the reasons can be anything: from incorrectly developed plugins, to incorrect operation Topics.

Related materials:

Why are characters displayed instead of text?

Recently, a friend of mine turned to me for help. He has a young website, which began to display various hieroglyphs instead of text. Since I...

How to add a Vkontakte comment form

Hi all! Recently, I received an order from a client, he wanted me to post a different comment form on his blog. From the plugin I suggested...

Video hosting for posting videos on movie sites

Hi all! Finishing the last article about Wordpress being a CMS for movie sites, I mentioned that in the next article I will write about video hosting, without which...

Error 500 (Internal Server Error) - internal server error - 4.2 out of 5 based on 9 votes

500 (Internal Server Error) - internal server error - HTTP protocol status code meaning that a specific error has occurred in the server configuration or one of its components has reported a failure. The error can be seen on sites built on a variety of CMS.

This error often occurs in CMSs such as WordPress, Joomla, Bitrix, OpenCart and others. Therefore, we will look at the most common causes of this error and how to fix it.

What does error 500 mean?

Error 500 means that software The server is running, but there are serious internal errors on its side. As a result, requests are not processed normally and in response to them the client (the visitor’s browser or search engine) receives an error code of 500.

In general, there can be a huge number of reasons why error 500 occurs; let’s look at those that occur most often.

The standard error page looks like this:

For what reasons can this error appear and how to fix it?

1. Incorrect access rights to folders and files. If on PHP files scripts hosted on your hosting have access rights of 777, then the execution of these scripts may be blocked by the server and you will be shown an error 500. This happens due to the fact that access rights of 777 allow everyone to make any changes to this file, which significantly affects security and the integrity of your site.

Solution: Check the access rights to the site folders and files. The recommended permissions for folders are 755, for executable scripts 600, and for all other files 644.

2. Very long work script. On hostings, in addition to PHP time limits for script execution, there is also a server-side limitation. Therefore, if the server does not receive a response within a certain amount of time set in its configuration, the script is forced to terminate and we see a 500 error message.

Solution: Try to optimize the script. You can also increase the server waiting time, but only if you have a VPS or dedicated server, on virtual hosting Will this gate be possible to do?

3. The .htaccess file contains incorrect or unsupported directives by the server. The .htaccess file has a very strict syntax and if you made certain errors while making certain settings, you will also be shown a 500 Internal Server Error.

Solution: Look to see if there is a .htaccess file in the root folder of the site. If it's there, make it backup copy and try to remove it completely. If after this the site works, then this is the reason.

You can also look at error information in the file where all server errors are recorded, this is the error.log file. If you specify an incorrect directive in the .htaccess file, you will find lines like this in the error.log file:

/home/UXXXXX/vash-sait.ru/www/.htaccess: Invalid command "RewritRule", perhaps mis-spelled or defined by a module not included in the server configuration

4. For its work, the script wants to receive too a large number of memory. This reason It can be on a shared hosting, where in addition to the memory limit set in PHP, the total amount of memory consumed by scripts is monitored. If this consumption is too high, i.e. more than allocated according to your tariff plan, then the script ends and a message about the 500th error is displayed. This was done to prevent excessive load on the server from each shared hosting account.







2024 gtavrl.ru.