How to resolve Magento's most common mistakes

How to resolve Magento's most common mistakes

Magento is a popular e-commerce content management system that allows us to manage our online store in a flexible and scalable way. Below, we explain how to resolve some of the most common errors you may encounter with Magento.
 
How to view error messages generated by Magento
Before reviewing the types of errors you may encounter with Magento, you need to know how to identify them. Magento is a CMS that manages its own errors and, when it fails, it displays a message like the following:
 
In the screenshot, we can see that Magento displays its own error code. To find out which error message it corresponds to, access your hosting account via FTP and, inside the directory where Magento is installed, go to /var/report/.
 
Inside this folder, you will find a file that corresponds to the code shown on the website. If you open this file, you will see the error message that has occurred.
 
Most Magento errors must be checked this way in order to determine what is causing the issue.
 
 
1.-  Memory limit
Whenever we run a process in Magento, the hosting account must have a sufficient memory limit set so that the application can complete the process being executed. If the memory limit is insufficient, you may see an error similar to the following: 
 
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 1024 bytes) in /usr/home/example.com/web/lib/Varien/Object.php on line 270
 
To fix this, you need to increase the PHP memory limit. You can do this from the hosting Control Panel under Configure PHP.
 
2.- Execution time
A similar error to the memory limit issue is the execution time error. When Magento attempts to run a process that requires more execution time, you may see an error like the following:
 
Fatal error: Maximum execution time of 30 seconds exceeded in /usr/home/example.com/web/lib/Zend/Db/Adapter/Abstract.php on line 0
 
To fix it, go to the Configure PHP section in the hosting Control Panel and increase the execution time.
 
3.-  Error establishing database connection
Magento, like all CMS platforms, needs to connect to your hosting account’s database in order to function. If it cannot connect, you may encounter the following message:
 
Access denied for user 'usuariMySQL'@'localhost' (using password: YES)";i:1;s:2933:"#0 /usr/home/example.com/web/lib/Zend/Db/Adapter/Pdo/Mysql.php
 
In this case, the error occurs because the MySQL username and password are not correctly configured in Magento. To fix this, connect via FTP and edit the local.xml file located inside /app/etc/ in the directory where Magento is installed.
 
When you open it, you will find several lines of code.
 
You need to verify that the data is correct. To find your hosting account’s MySQL connection details, go to the MySQL section in the hosting Control Panel.
 
 4.- The page does not load
Sometimes, your Magento website may randomly fail to load. In some browsers, the error message  ERR_EMPTY_RESPONSE may appear. When this behavior occurs, it may be caused by the PHP module APC.
 
To prevent this behavior, you can disable the use of APC through the .htaccess file.
 
Inside the Magento .htaccess file, which you can access via FTP, add the following line: 
 
php_flag apc.cache_by_default Off
 
This should prevent the issue from occurring again. 
 
5.- Changes are not applied
When we apply changes in Magento, or even fix an error, we may find that no changes are visible. This happens because Magento uses a cache system and retains the previous state of the website. 
 
We can regenerate the cache from the Magento administration panel, or, if we do not have access, we can connect via FTP.  Go to the directory where Magento is installed and then enter the /var/ folder.
 
Inside /var/, there is a folder called cache. Delete it.
 
Once deleted, access the website again and the changes should now be visible. At the same time, a new cache folder will be automatically generated.
  
For more information, you can contact us.
    • Related Articles

    • How to resolve Joomla's most common mistakes

      Joomla is a popular content management system that allows us to create dynamic websites easily. One of its particular features is the ability to add new functionalities through extensions such as components, modules, templates, and plugins. Like all ...
    • How to resolve the most common PrestaShop errors

      PrestaShop is one of the most popular CMS platforms for online stores. It offers a wide range of plugins, modules, and themes to customize and add new functionalities to your shop. As usual, while working with the application, error messages may ...
    • How to modify the Magento associated domain

      When we modify the site of our Magento installation, the website loads incorrectly. This happens because, at the time we installed Magento, the current path was registered. To modify the paths of our installation, we need to manage the Magento ...
    • What is and how to fix the ERR_TOO_MANY_REDIRECTS error

      It is likely that while browsing the internet or even on your own website, you may have encountered an ERR_TOO_MANY_REDIRECTS message indicating that there are too many redirects to complete the connection. The error usually looks like this: This ...
    • What to do in case of overconsumption in our accommodation

      When the applications you have hosted generate high server resource consumption, it can affect the rest of the websites hosted on the same machine. For this reason, when cdmon technicians detect this consumption, they inform you via email. This ...