Page 1 of 1

Changing Local PHP Memory Limit

Posted: Sun Sep 23, 2012 1:22 am
by JackStone
Hi,

I have an issue with Joomla 2.5.7 running on an IIS 7.5 with PHP 5.4. No matter what I do, I am unable to change the LOCAL php memory limit. It always stays at 128M.
I managed to change the master value but the local value is still 128M.

I also added the ini_set('memory_limit','2048M') to index.php, configuration.php and so on but nothing worked.

You have any tip how to progress here? Probably setting memory limit local in a web.config file?

Thanks for help!

Regards,
Jack

Re: Changing Local PHP Memory Limit

Posted: Sun Sep 23, 2012 11:03 am
by Per Yngve Berg
Mod. Note: Relocated the topic to the Installation J2.5 on IIS web server.

The file for a IIS server is web.config.

Why do you need such a huge amount of memory? 128M is enough for most sites. Maybe try to change it to 256M.

Re: Changing Local PHP Memory Limit

Posted: Sun Sep 23, 2012 3:07 pm
by humvee
Also you need to check whether the host, if you are on one, allows local editing of the the memory limit.

You should not add the additional code to any Joomla files whatsoever as it has nothing to do with the Joomla Platform or CMS.

If you are running a localhost installation IIS MySQL and PHP then you edit the main php.ini file in the php/ directory of the installation.

If you are on a remote host and your host permits you to make the changes to your memory_limit then you could try adding the changes to a php.ini file placed in the joomla_root/ and joomla_root/administrator/ directories. Unlike the htaccess file php.ini files do not cascade to lower files and directories so you must have both of them. Or as stated use the web.config file. Either way the code must be correctly added in accordance with PHP rules.

Finally, I would concur with the query - why do you need a 2GB memory limit when most servers function perfectly with 128MB?