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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   1577 Views

Avatar
paradigm

Community Member, 5 Posts

26 November 2011 at 10:00pm

Hi,

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?

Thanks,
David.

Avatar
(deleted)

Community Member, 473 Posts

26 November 2011 at 11:26pm

From http://php.net/manual/en/configuration.file.per-user.php:
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.

Avatar
paradigm

Community Member, 5 Posts

26 November 2011 at 11:34pm

Thank you Simon for your solution, it worked perfectly.

-David.