Allowed memory size of 41943040 bytes Latest WordPress

This time I will share a little experience on WordPress about the error that Surgeonmal experienced. An error appears when I install multiple plugins such as Yoast and Ads Insert. However, this error can also occur with other plugins.

Examples of error messages that appear:

PHP Fatal error:  Allowed memory size of 41943040 bytes exhausted (tried to allocate 32768 bytes) in /home/.../public_html/wp-content/plugins/adsinserter/includes/api/v1/class-wc-rest-products-controller.php on line 1734

I was also confused, because I failed to do plugin settings, template settings, etc. several times due to this error. After browsing here and there, I finally found an easy way to overcome Fatal error: 41943040 bytes of memory allowed What I experienced in wordpress.

To improve WordPress reeor, this can be done via cpanel and ftp. Please see the tutorial below:

1. CPANEL

  • Login to your cpanel account
  • Click on file manager
  • Many folders will appear, please enter the folder public_html By clicking 2x.
  • Please enter the folder where your website is located.
  • Once inside the web installation folder, select the file Wp-config.php, Right click and select Edit.
  • So please add the following code
define('WP_MEMORY_LIMIT','256M');
  • For example shown below
  • After that, please click on save button to save the configuration
  • done

2. FTP

This second solution is for those of you who use vps / panels other than cpanel.

  • Login to your respective FTP server accounts
  • Enter menu public_html Again Wp-config.php
  • Select Edit / View wp-config.php file.
  • Add the following code:
define('WP_MEMORY_LIMIT','256M');
  • Save to save configuration
  • done

Okay, those were some of the mistakes I had overcoming WordPress errors. Hope this is useful.

Add a Comment

Your email address will not be published. Required fields are marked *