Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 31436096 bytes)

陌路散爱 提交于 2019-12-12 15:26:35

问题


I'm new to Joomla and I'm now using Joomla 1.6

The problem I encounter is when I try to upload an extension via the admin tool and I get the following error message:

"Fatal error: Allowed memory size of 25165824 bytes exhausted (tried to allocate 31436096 bytes)
 in C:\AppServ\www\libraries\joomla\filesystem\file.php on line 295"

I've read some relevant messages but didn't get it solved. The phpinfo returns a value which I think may be relevant:

1)upload_max_filesize      local value=200; master value=200

Am I correct? If yes, how can I change it? (I can't remote to the server.)


回答1:


Seems to be you're running out of the allowed memory size.

Try to optimize your code and query.

Also you can change the php ini settings.

Here is the one .htaccess solution

php_value memory_limit 1000M
php_value max_execution_time 6000000

I've added arbitrary values, just change based on your requirements. And put this .htaccess at your projects root folder such that this changes will only be applicable to your project folder...




回答2:


Your memory limit (24 Megabyte) is rather low for Joomla and especially for its updater. I recommend at least 32 Megabyte, better 64 Megabyte.

The how to change is it is dependent on your server environment. If you have access to your php.ini you should look for a line that contains memory_limit and set its value to 32M (or 64M or whatever value works for you)

In case you can't access the php.ini try setting it trough the .htaccess file:

php_value memory_limit 1000M

If that also fails you should contact your hoster. Some have a web interface to allow changing this settings. Unfortunately others doesn't allow changing it at all. Your only chance is begging your hoster to change its server configuration.




回答3:


Try... put top of the file ini_set('memory_limit', '-1');



来源:https://stackoverflow.com/questions/11606282/fatal-error-allowed-memory-size-of-25165824-bytes-exhausted-tried-to-allocate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!