lundi 5 octobre 2015

PHP Allocationg memory in WP does not work

I am runing a WP site and I am the root user of the VPS that is running right now.

So, when I am up to publish/create a new page it returns me the following message:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in /home/.../public_html/wp-includes/compat.php on line 123

I have already search and read a various of articles about that problem. So I have done the following things:

From my whm -> php configs And I have allocate in memory_limit : 512M

Also, I have define at the top in wp-config.php file the following command:

define('WP_MEMORY_LIMIT', '512M');

However, I am still getting the error.

Additionally, I tried to insert the following in my .htaccess but it didn't work.

<IfModule mod_php5.c>
     php_value memory_limit 512M
</IfModule>

I have allocated more than 1GB but it didnt work.

Also, I have re-install the whole WP framework to the latest version.

Plus, I have restart the apache a couple of times to see the current setting on php, but i think that is not necessary. Right?

I have add the plugin: WP Overview (lite) to see the php allocation and I have that values:

Mem: WP 512M (def) Usage 16% 81.03M of PHP Limit 512M

Finally, I have created 2 test files to see the allocation:

File1:

<? phpinfo(); ?>

It returns that I have 512M php allocation which is correct.

File2: <?php echo memory_get_usage(); ?> which returns

213696

Is the this returning correct?? I thought that it should return 512M in bytes.. Right?

Any idea about the problem ? I am stacked on this issue.



via Chebli Mohamed

1 commentaire:

  1. WordPress’in temel parçalarından birisi kuşkusuz wp-includes’tir. CMS’yi oluşturan çekirdek parçalarının tamamının burada olduğunu söyleyebiliriz. Bu durumda sitenizin güvenilirliğini sağlamak adına bu klasöre ciddi bir şekilde önem göstermelisiniz. Bu yazımda WordPress wp-includes klasörünün korunması konusuna bakacağız.
    https://www.dogushan.com/wordpress-wp-includes-klasorunun-korunmasi/
    https://www.dogushan.com

    RépondreSupprimer