Getting memory use fatal error - php

My joomla website was working fine and now is giving this error:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 72 bytes) in ...public_html/libraries/vendor/joomla/string/src/phputf8/substr_replace.php on line 20.
I know the obvious answer is to upgrade the php.ini memory to 512M but my hosting doesn't allow it. First it was here and now
Is there other way to solve it?

In case you don't have access to php.ini, Just create a .htaccess file in your joomla website root folder and add this line to it:
php_value memory_limit 512M

Related

Why am I getting a fatal memory error on WordPress?

I get the following error when I try to open the sitemap.xml of my WordPress blog:
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 1052672 bytes) in /xxx/wp-content/plugins/wordpress-seo/inc/sitemaps/class-taxonomy-sitemap-provider.php on line 131
Link to the Sitemap: https://dooiz.com/sitemap_index.xml
The answer is actually pretty obvious. You have to increase the memory limit of your webspace.
Write this in your wp-config under the debug line:
define( 'WP_MEMORY_LIMIT', '512M' );
you could also try writing the following in the .htaccess file
php_value memory_limit 512M
Or ask your webspace provider how and if you can increase the memory limit.

Fatal error: Allowed Memory size of 67108864 in opencart

I'm using opencart. In my admin page when I access CATALOG>PRODUCTS (I have 73 products - Totally I have four pages). When I access my second page it shows this following error
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 4000 bytes) in /home/justborn/public_html/system/library/image.php on line 34
But, I can access first, third and fourth page. I have tried this solution (Allowed memory size of 67108864 bytes exhausted (tried to allocate 4459414 bytes) in writing an xml file) in my .htaccess file
php_value memory_limit 128M
But, it returns 500 Internal error.. How do I solve this Fatal error: Allowed Memory size of 67108864 ?
I have found the Solution
In my admin folder I have a php.ini file
I have changed my memory_limit = 64M; to memory_limit = 128M;. Now it works fine.. I didn't get Fatal Error.
Check your images size in filemanager: there might be some big sized images.
I had 2.9MB size of picture which created such trouble to me.
Now, after reducing the size I've solved it.
Memory limit is more than enough.
It seems that there is some endless loop in the script that is not letting it to terminate.
Look for any for, while, do while loop in the script.
If above remedy does not works, please share code so that issue can be examined further.
you have to change the php.ini file on line 18 memory_limit = 64M; to 64 x 2 = 124 or 64 x 4 = 256 but wait ask your hosting provider does they support higher limit size if yes then it will work otherwise you are wasting your energy
This is the same problem I faced,
"Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 8192 bytes) in opencart system/library/image.php on line 26"
This error appears when we upload large images (1.5 MB+ size), at the time of editing the images Opencart system/library/image.php tries to load those images and in order to load BIG images it needs more memory.
In order solve this there are two ways.
1. For shared hosting users
1.1 Open File Manager from cPanel or FTP to your website
1.2 Go to "public_html/image/catalog"
1.3 Look for Big Images and Download and delete those images from the server.
VPS - Dedicated - Cloud - Server where we can manage php.ini
2.1 In admin folder open php.ini file
2.2 Try to increase from memory_limit = 64M; to memory_limit = 128M; or more as required.
This should solve the problem.
I would personally advice to upload optimized images and use solution 1 that is deleting Big Images, this is not create any load on the server.

Open Cart Fatal error: Allowed memory size Issue

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 38312699 bytes) in
/home1/eshoppaz/public_html/vqmod/vqcache/vq2-system_engine_controller.php
on line 58
How do I go about resolving this issue?
You have to change the memory_limit on the root and within the admin folder, I noticed that nobody pointed this out and it worked for me.
If you have access to the php.ini file, set the memory_limit option to 128M.
If you don't have access to it, you can try to set it in the .htaccess with:
php_value memory_limit 128M
If you change it on php.ini file don't forget restart the server after change the value.
Your server have the memory_limit set to 64Mb and Open Cart need a little more (with your error it needs 36Mb more). Also i seen on other forums that people set memory_limit to 256M to avoid problems.
I hope this help you.

Increase PHP performance PHP INI

The server is hosted by JustHost and on there are a few separate domains. I am uploading files to wordpress blog on one of the domains and my import only gets through 1332 records each time.
I think this is because there is not sufficient amount of data allowed to upload. I have changed the PHP.ini and it is now really fast, but still same number of records are uploading.
I have put a PHP ini in the public HTML folder and also one in the site route domain folder but am still getting the same results.
post_max_size = 500M
upload_max_filesize = 400M
max_execution_time = 3000
max_input_time = 6000
memory_limit = 2200M
I have also put this line in the wordpress config file
define('WP_MEMORY_LIMIT', '2200M');
Any suggestions?
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 44 bytes) in /home/divethe1/public_html/callinggrove.co.uk/wp-includes/kses.php on line 991
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 44 bytes) in
/home/divethe1/public_html/callinggrove.co.uk/wp-includes/kses.php on
line 991
This kind of error is caused by a memory leak in your code its not related to your server config, your building a string or storing a value that is exponentially being assigned growing by its own value on each iteration.
<?php //$str is added to $str
$str = str_repeat('abc',1000);
for($i=0;$i<=100;$i++){
$str = $str.$str;
}?>
or in your case your perhaps building an array of the posts you have added with the entire content added to a value and its running out of memory.
Plz post some of your code around where the error occurs.
If possible try to use a persistent connection.
I don't know if you can do that using wordpress.

CodeIgniter Stacl Trace

I want to log the stack trace from time to time in my application folder.
writing to the log the result of debug_backtrace() , will cause to:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 11639862 bytes) in /var/www/trunk/api.subdomain.com/libraries/MY_Log.php on line 13
because of the MVC structure, how can i get the last 10 functions calls/stack.
Thanks
Try to change the memory_limit settings of your php.ini.
If you are using some hosting services and you don't have access to the php.ini, you can still change those settings using some .htaccess file and the php_value directive or ini_set function.
.htaccess example:
php_value memory_limit 16M

Categories