Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fatal error: Allowed memory size of 83886080 bytes exhausted


Buddym

Recommended Posts

Hello Guys,

 

I have the following problem when I go to the Catalog in my admin.

 

Fatal error: Allowed memory size of 83886080 bytes exhausted (tried to allocate 24535 bytes) in /var/www/vhosts/onlinecontactlenses.nl/httpdocs/admin/includes/functions/general.php on line 280

 

I don't know why I receive this errors but my website designer has changed some code and now I receive this error. He thinks it's not due to him.

 

I only know that I didn't received this error before.

 

I see several posts that I must increase the memory in the php.ini file and my shared hosting provider told me we can do that ourself by going to change it in the .htacces file. It's now standard 32 MB but he and I think that it must normally be more then enough.

He also thinks that it's due to an error in an script.

 

Does someone has a solution for me.

 

Marco

Link to comment
Share on other sites

You can change the memory limit for one specific file by including a line such as this at the top of the script:

 

ini_set("memory_limit","32M");

 

The 32M sets the limit to 12 megabytes.

 

You can also make this change permanently for all PHP scripts running on the server by adding a line like this to the server's php.ini file:

 

create a file called php.txt and delete all info in that file then add:

 

memory_limit = 32M

 

Upload to your catalog folder and rename to php.ini

 

HTH

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

Don't you know why this error happens?

Good, let them guess. Never post in what function line 280 is. God forbid the forum members would come with a suggestion of where the error is. Then you would have nothing to post and complain about!

Link to comment
Share on other sites

I don't complain but I'm searching for a solution.

It looks like nobody knows how we can solve this and why this error happens.

 

Will it help if I post the code from the function where line 280 is.

Link to comment
Share on other sites

I don't complain but I'm searching for a solution.

And without adequate information most of the times nobody can help you.

It looks like nobody knows how we can solve this and why this error happens.

See above, nothing to do with the ability of the people here.

Will it help if I post the code from the function where line 280 is.

I have seen that line on the Dutch (unofficial) osC forum and either you posted the wrong line number or your developer made a mess of the includes/function/general.php (perhaps with opening and closing parentheses { } ) so no, posting that function is not really useful.

Link to comment
Share on other sites

I don't complain but I'm searching for a solution.

Perhaps it is worthwhile to try to change something in admin/includes/application_top.php.

Normally, that file general.php is loaded before html_output.php:

// define our general functions used application-wide
 require(DIR_WS_FUNCTIONS . 'general.php');
 require(DIR_WS_FUNCTIONS . 'html_output.php');

If you put the second require before the first you might get the error on another line or in html_output. Then the error would have nothing to do with the code in general.php.

Link to comment
Share on other sites

I had put the second require before the first one but I received the same error on the same line.

In general.php there was nothing changed. I will post the code from line 280 with the code from the function where it belongs to. Mabe that someone sees something wrong.

 

function tep_get_category_tree($parent_id = '0', $spacing = '', $exclude = '', $category_tree_array = '', $include_itself = false) {
global $languages_id;

if (!is_array($category_tree_array)) $category_tree_array = array();
if ( (sizeof($category_tree_array) < 1) && ($exclude != '0') ) $category_tree_array[] = array('id' => '0', 'text' => TEXT_TOP);

if ($include_itself) {
  $category_query = tep_db_query("select cd.categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " cd where cd.language_id = '" . (int)$languages_id . "' and cd.categories_id = '" . (int)$parent_id . "'");
  $category = tep_db_fetch_array($category_query);
  $category_tree_array[] = array('id' => $parent_id, 'text' => $category['categories_name']);
}

$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and c.parent_id = '" . (int)$parent_id . "' order by c.sort_order, cd.categories_name");
while ($categories = tep_db_fetch_array($categories_query)) {
  if ($exclude != $categories['categories_id']) $category_tree_array[] = array('id' => $categories['categories_id'], 'text' => $spacing . $categories['categories_name']);
  $category_tree_array = tep_get_category_tree($categories['categories_id'], $spacing . '   ', $exclude, $category_tree_array);
}

return $category_tree_array;
 }

Link to comment
Share on other sites

I had put the second require before the first one but I received the same error on the same line.

In general.php there was nothing changed. I will post the code from line 280 with the code from the function where it belongs to. Mabe that someone sees something wrong.

If line 280 is in tep_get_category_tree you might want to try the tep_get_category_tree optimization contribution and the Optimize categories box one to speed things up in the admin and the catalog.

Link to comment
Share on other sites

I don't seem to be able to replicate the error - What page are you seeing this on?

 

someone else another solution. My webdesigner tried this and he said it didn't help.

 

If you want to send me some ftp login info via Pm I will take a look for you

 

Regards

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

Thanks for your answers!

 

I will look if that will help.

 

I receive the error in the admin when I click on Catalogs. (www.mysite.com/admin_directory/categories.php?selected_box=catalog )

 

I don't seem to be able to replicate the error - What page are you seeing this on?

If you want to send me some ftp login info via Pm I will take a look for you

 

Regards

Link to comment
Share on other sites

Hello Guys,

 

I have the following problem when I go to the Catalog in my admin.

 

Fatal error: Allowed memory size of 83886080 bytes exhausted (tried to allocate 24535 bytes) in /var/www/vhosts/onlinecontactlenses.nl/httpdocs/admin/includes/functions/general.php on line 280

 

I don't know why I receive this errors but my website designer has changed some code and now I receive this error. He thinks it's not due to him.

 

I only know that I didn't received this error before.

 

I see several posts that I must increase the memory in the php.ini file and my shared hosting provider told me we can do that ourself by going to change it in the .htacces file. It's now standard 32 MB but he and I think that it must normally be more then enough.

He also thinks that it's due to an error in an script.

 

Does someone has a solution for me.

 

Marco

 

There apppears to be a recursive call will a parent becming a child at some level.

 

This will result in an infinite loop and so memory overflow.

Analyse Your data base.

parent category id.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...