Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Php.ini ignored

Go to End

3 Posts   953 Views


Community Member, 5 Posts

26 November 2011 at 10:00pm


when I access a page without mod_rewrite (e.g. "/index.php/about-us") the correct php.ini - in the root of the Silverstripe site - is loaded and enough memory is allowed for the site to run. However if I just access "/about-us" the default php.ini for the hosting account is read and the site will error with a memory exhausted fatal error.

I am using a shared web host (CPanel) and am at a complete loss as to why it would be loaded in all cases except when using mod_rewrite.

Has anyone encountered this issue and found a workaround for it?



Community Member, 473 Posts

26 November 2011 at 11:26pm

In addition to the main php.ini file, PHP scans for INI files in each directory, starting with the directory of the requested PHP file, and working its way up to the current document root (as set in $_SERVER['DOCUMENT_ROOT']). In case the PHP file is outside the document root, only its directory is scanned.

In many shared hosting environments, this is the case. As the mod_rewrite rules handle the request to sapphire/main.php, PHP will only look for a user ini file in sapphire.


Community Member, 5 Posts

26 November 2011 at 11:34pm

Thank you Simon for your solution, it worked perfectly.